Skip to content

reject reserved close code 1006 in websocket reader - #13536

Open
arshsmith1 wants to merge 1 commit into
aio-libs:masterfrom
arshsmith1:ws-reject-reserved-close-code
Open

reject reserved close code 1006 in websocket reader#13536
arshsmith1 wants to merge 1 commit into
aio-libs:masterfrom
arshsmith1:ws-reject-reserved-close-code

Conversation

@arshsmith1

Copy link
Copy Markdown
Contributor

A Close frame's status code is checked in WebSocketReader._handle_frame against ALLOWED_CLOSE_CODES, a set built from the WSCloseCode enum. The enum carries ABNORMAL_CLOSURE (1006), which aiohttp only sets locally when a connection drops without a Close frame, so a frame that arrives with 1006 on the wire passed the check and was delivered as a valid close code (and could be echoed back in aiohttp's own close frame). RFC 6455 7.4.1 reserves 1006, along with 1005 and 1015, and forbids it as a status code on the wire, so 1006 is now rejected as a protocol error the same way 1005 and 1015 already are.

What do these changes do?

Exclude ABNORMAL_CLOSURE from the incoming-frame acceptance set so a Close frame carrying 1006 fails with a protocol error. 1005 and 1015 were already rejected because they are not enum members; only 1006 slipped through.

Are there changes in behavior for the user?

Only for the malformed case. A peer that sends 1006 in a Close frame now trips a protocol error instead of surfacing as a close message. The locally-generated 1006 for an abnormal closure (no Close frame received) is unchanged.

Is it a substantial burden for the maintainers to support this?

No. It drops one reserved code from the acceptance set and adds a regression test beside the existing close-code tests.

Related issue number

None.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes - N/A, no public API change
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt (already listed)
  • Add a new news fragment into the CHANGES/ folder

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Aug 24, 2026
@arshsmith1
arshsmith1 force-pushed the ws-reject-reserved-close-code branch from 4d003f2 to 5a050bf Compare August 24, 2026 07:06
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or compatibility issues identified.

Incoming code 1006 is now rejected at the existing close-code validation boundary without changing locally generated abnormal-closure handling.

Reviews (1): Last reviewed commit: "reject reserved close code 1006 in webso..." | Re-trigger Greptile

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
4955 2 4953 177
View the full list of 2 ❄️ flaky test(s)
tests.autobahn.test_autobahn::test_client

Flake rate in main: 4.76% (Passed 20 times, Failed 1 times)

Stack Traces | 36.7s run time
report_dir = PosixPath('.../pytest-of-runner/pytest-0/reports0')
request = <FixtureRequest for <Function test_client>>

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.autobahn#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_client#x1B[39;49;00m(report_dir: Path, request: pytest.FixtureRequest) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        autobahn_container = docker.run(#x1B[90m#x1B[39;49;00m
            detach=#x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            image=#x1B[33m"#x1B[39;49;00m#x1B[33mautobahn-testsuite#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            name=#x1B[33m"#x1B[39;49;00m#x1B[33mautobahn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            remove=#x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            volumes=[#x1B[90m#x1B[39;49;00m
                (request.path.parent / #x1B[33m"#x1B[39;49;00m#x1B[33mclient#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33m/config#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
                (report_dir, #x1B[33m"#x1B[39;49;00m#x1B[33m/reports#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            ],#x1B[90m#x1B[39;49;00m
            networks=(#x1B[33m"#x1B[39;49;00m#x1B[33mhost#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,),#x1B[90m#x1B[39;49;00m
            command=(#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mwstest#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33m--mode#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mfuzzingserver#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33m--spec#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33m/config/fuzzingserver.json#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            wait_for_port(#x1B[94m9001#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subprocess.run(#x1B[90m#x1B[39;49;00m
                (#x1B[90m#x1B[39;49;00m
                    sys.executable,#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[33m-m#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[33mcoverage#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[33mrun#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[33m--append#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[.../autobahn/client/client.py#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                ),#x1B[90m#x1B[39;49;00m
                env={#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[33mCOVERAGE_PARALLEL_MODE#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mfalse#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                    **os.environ.copy(),#x1B[90m#x1B[39;49;00m
                },#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
        #x1B[94mfinally#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            autobahn_container.stop()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        results = get_test_results(report_dir / #x1B[33m"#x1B[39;49;00m#x1B[33mclients#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33maiohttp#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        xfail = {#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m7.9.5#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mThe close code should have been 1002 or empty#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.1.4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.1.5#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.1.6#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.2.4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 10 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.2.5#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.2.6#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.2#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.5#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.6#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.7#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.8#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.9#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.2#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.5#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.6#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.7#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.8#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.9#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
>       #x1B[94massert#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m process_xfail(results, xfail)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

autobahn_container = <[NoSuchContainer("The command executed was `.../usr/bin/docker container inspect 7287ad61aba205a09605908d912bff9b2e556c3...61aba205a09605908d912bff9b2e556c396f6eeff88b10712ffc6b214e\n'\n") raised in repr()] Container object at 0x7f6c144a7770>
report_dir = PosixPath('.../pytest-of-runner/pytest-0/reports0')
request    = <FixtureRequest for <Function test_client>>
results    = (('1.1.1', 'OK', None), ('1.1.2', 'OK', None), ('1.1.3', 'OK', None), ('1.1.4', 'OK', None), ('1.1.5', 'OK', None), ('1.1.6', 'OK', None), ...)
xfail      = {'7.9.5': 'The close code should have been 1002 or empty', '9.1.4': 'Did not receive message within 100 seconds.', '9.1.5': 'Did not receive message within 100 seconds.', '9.1.6': 'Did not receive message within 100 seconds.', ...}

#x1B[1m#x1B[31mtests/autobahn/test_autobahn.py#x1B[0m:153: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

results = (('1.1.1', 'OK', None), ('1.1.2', 'OK', None), ('1.1.3', 'OK', None), ('1.1.4', 'OK', None), ('1.1.5', 'OK', None), ('1.1.6', 'OK', None), ...)
xfail = {'7.9.5': 'The close code should have been 1002 or empty', '9.1.4': 'Did not receive message within 100 seconds.', '9.1.5': 'Did not receive message within 100 seconds.', '9.1.6': 'Did not receive message within 100 seconds.', ...}

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mprocess_xfail#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        results: #x1B[96mtuple#x1B[39;49;00m[Result, ...], xfail: #x1B[96mdict#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, #x1B[96mstr#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    ) -> #x1B[96mlist#x1B[39;49;00m[#x1B[96mdict#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, #x1B[96mobject#x1B[39;49;00m]]:#x1B[90m#x1B[39;49;00m
        failed = []#x1B[90m#x1B[39;49;00m
        #x1B[94mfor#x1B[39;49;00m number, status, details #x1B[95min#x1B[39;49;00m results:#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m number #x1B[95min#x1B[39;49;00m xfail:#x1B[90m#x1B[39;49;00m
>               #x1B[94massert#x1B[39;49;00m status #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m {#x1B[33m"#x1B[39;49;00m#x1B[33mOK#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mINFORMATIONAL#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}  #x1B[90m# Strict xfail#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE               AssertionError: assert 'OK' not in {'INFORMATIONAL', 'OK'}#x1B[0m

details    = None
failed     = []
number     = '7.9.5'
results    = (('1.1.1', 'OK', None), ('1.1.2', 'OK', None), ('1.1.3', 'OK', None), ('1.1.4', 'OK', None), ('1.1.5', 'OK', None), ('1.1.6', 'OK', None), ...)
status     = 'OK'
xfail      = {'7.9.5': 'The close code should have been 1002 or empty', '9.1.4': 'Did not receive message within 100 seconds.', '9.1.5': 'Did not receive message within 100 seconds.', '9.1.6': 'Did not receive message within 100 seconds.', ...}

#x1B[1m#x1B[31mtests/autobahn/test_autobahn.py#x1B[0m:75: AssertionError
tests.autobahn.test_autobahn::test_server

Flake rate in main: 3.70% (Passed 26 times, Failed 1 times)

Stack Traces | 479s run time
report_dir = PosixPath('.../pytest-of-runner/pytest-0/reports0')
request = <FixtureRequest for <Function test_server>>

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.autobahn#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_server#x1B[39;49;00m(report_dir: Path, request: pytest.FixtureRequest) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        server = subprocess.Popen(#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                sys.executable,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33m-m#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mcoverage#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mrun#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33m--append#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[.../autobahn/server/server.py#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            env={#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mCOVERAGE_PARALLEL_MODE#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mfalse#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                **os.environ.copy(),#x1B[90m#x1B[39;49;00m
            },#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            wait_for_port(#x1B[94m9001#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            docker.run(#x1B[90m#x1B[39;49;00m
                image=#x1B[33m"#x1B[39;49;00m#x1B[33mautobahn-testsuite#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                name=#x1B[33m"#x1B[39;49;00m#x1B[33mautobahn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                remove=#x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                volumes=[#x1B[90m#x1B[39;49;00m
                    (request.path.parent / #x1B[33m"#x1B[39;49;00m#x1B[33mserver#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33m/config#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
                    (report_dir, #x1B[33m"#x1B[39;49;00m#x1B[33m/reports#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
                ],#x1B[90m#x1B[39;49;00m
                networks=(#x1B[33m"#x1B[39;49;00m#x1B[33mhost#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,),#x1B[90m#x1B[39;49;00m
                command=(#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[33mwstest#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[33m--mode#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[33mfuzzingclient#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[33m--spec#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[33m/config/fuzzingclient.json#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                ),#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
        #x1B[94mfinally#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            server.terminate()#x1B[90m#x1B[39;49;00m
            server.wait()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        results = get_test_results(report_dir / #x1B[33m"#x1B[39;49;00m#x1B[33mservers#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mAutobahnServer#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        xfail = {#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m7.9.5#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mThe close code should have been 1002 or empty#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.1.4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.1.5#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.1.6#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.2.4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 10 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.2.5#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.2.6#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.2#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.5#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.6#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.7#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.8#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.3.9#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.2#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.5#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.6#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.7#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.8#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m9.4.9#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mDid not receive message within 100 seconds.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
>       #x1B[94massert#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m process_xfail(results, xfail)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

report_dir = PosixPath('.../pytest-of-runner/pytest-0/reports0')
request    = <FixtureRequest for <Function test_server>>
results    = (('1.1.1', 'OK', None), ('1.1.2', 'OK', None), ('1.1.3', 'OK', None), ('1.1.4', 'OK', None), ('1.1.5', 'OK', None), ('1.1.6', 'OK', None), ...)
server     = <Popen: returncode: 0 args: ('.../aiohttp/aiohttp/.venv/bin/py...>
xfail      = {'7.9.5': 'The close code should have been 1002 or empty', '9.1.4': 'Did not receive message within 100 seconds.', '9.1.5': 'Did not receive message within 100 seconds.', '9.1.6': 'Did not receive message within 100 seconds.', ...}

#x1B[1m#x1B[31mtests/autobahn/test_autobahn.py#x1B[0m:223: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

results = (('1.1.1', 'OK', None), ('1.1.2', 'OK', None), ('1.1.3', 'OK', None), ('1.1.4', 'OK', None), ('1.1.5', 'OK', None), ('1.1.6', 'OK', None), ...)
xfail = {'7.9.5': 'The close code should have been 1002 or empty', '9.1.4': 'Did not receive message within 100 seconds.', '9.1.5': 'Did not receive message within 100 seconds.', '9.1.6': 'Did not receive message within 100 seconds.', ...}

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mprocess_xfail#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        results: #x1B[96mtuple#x1B[39;49;00m[Result, ...], xfail: #x1B[96mdict#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, #x1B[96mstr#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    ) -> #x1B[96mlist#x1B[39;49;00m[#x1B[96mdict#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, #x1B[96mobject#x1B[39;49;00m]]:#x1B[90m#x1B[39;49;00m
        failed = []#x1B[90m#x1B[39;49;00m
        #x1B[94mfor#x1B[39;49;00m number, status, details #x1B[95min#x1B[39;49;00m results:#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m number #x1B[95min#x1B[39;49;00m xfail:#x1B[90m#x1B[39;49;00m
>               #x1B[94massert#x1B[39;49;00m status #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m {#x1B[33m"#x1B[39;49;00m#x1B[33mOK#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mINFORMATIONAL#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}  #x1B[90m# Strict xfail#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE               AssertionError: assert 'OK' not in {'INFORMATIONAL', 'OK'}#x1B[0m

details    = None
failed     = []
number     = '7.9.5'
results    = (('1.1.1', 'OK', None), ('1.1.2', 'OK', None), ('1.1.3', 'OK', None), ('1.1.4', 'OK', None), ('1.1.5', 'OK', None), ('1.1.6', 'OK', None), ...)
status     = 'OK'
xfail      = {'7.9.5': 'The close code should have been 1002 or empty', '9.1.4': 'Did not receive message within 100 seconds.', '9.1.5': 'Did not receive message within 100 seconds.', '9.1.6': 'Did not receive message within 100 seconds.', ...}

#x1B[1m#x1B[31mtests/autobahn/test_autobahn.py#x1B[0m:75: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@codspeed-hq

codspeed-hq Bot commented Aug 24, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 14.86%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 91 untouched benchmarks
⏩ 83 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
test_list_element_pattern_redos_payload[whitespace_run_after_content] 28.3 ms 33.3 ms -14.86%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing arshsmith1:ws-reject-reserved-close-code (5a050bf) with master (fdebfa2)

Open in CodSpeed

Footnotes

  1. 83 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant