Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test invalid chunked body #10587

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Test invalid chunked body #10587

wants to merge 5 commits into from

Conversation

Dreamsorcerer
Copy link
Member

No description provided.

Copy link

codecov bot commented Mar 17, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
3458 1 3457 45
View the top 1 failed test(s) by shortest run time
tests.test_http_parser test_parse_payload_response_with_invalid_body[c-parser-pyloop]
Stack Traces | 0.094s run time
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
protocol = <NonCallableMagicMock spec_set='BaseProtocol' id='4379990992'>
response_cls = <class 'aiohttp._http_parser.HttpResponseParser'>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_parse_payload_response_with_invalid_body#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        loop: asyncio.AbstractEventLoop,#x1B[90m#x1B[39;49;00m
        protocol: BaseProtocol,#x1B[90m#x1B[39;49;00m
        response_cls: Type[HttpResponseParser],#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        parser = response_cls(protocol, loop, #x1B[94m2#x1B[39;49;00m**#x1B[94m16#x1B[39;49;00m, response_with_body=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        text = (#x1B[90m#x1B[39;49;00m
            #x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mHTTP/1.1 200 Ok#x1B[39;49;00m#x1B[33m\r#x1B[39;49;00m#x1B[33m\n#x1B[39;49;00m#x1B[33mTransfer-Encoding: chunked#x1B[39;49;00m#x1B[33m\r#x1B[39;49;00m#x1B[33m\n#x1B[39;49;00m#x1B[33m\r#x1B[39;49;00m#x1B[33m\n#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m7#x1B[39;49;00m#x1B[33m\r#x1B[39;49;00m#x1B[33m\n#x1B[39;49;00m#x1B[33mchunked#x1B[39;49;00m#x1B[33m\r#x1B[39;49;00m#x1B[33m\n#x1B[39;49;00m#x1B[33m0#x1B[39;49;00m#x1B[33m\r#x1B[39;49;00m#x1B[33m\n#x1B[39;49;00m#x1B[33m\r#x1B[39;49;00m#x1B[33m\n#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        #x1B[94mwith#x1B[39;49;00m pytest.raises(http_exceptions.BadHttpMessage, match=#x1B[33m"#x1B[39;49;00m#x1B[33mstatus line#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>           parser.feed_data(text)[#x1B[94m0#x1B[39;49;00m][#x1B[94m0#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m

loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
parser     = <aiohttp._http_parser.HttpResponseParser object at 0x10551f5e0>
protocol   = <NonCallableMagicMock spec_set='BaseProtocol' id='4379990992'>
response_cls = <class 'aiohttp._http_parser.HttpResponseParser'>
text       = b'HTTP/1.1 200 Ok\r\nTransfer-Encoding: chunked\r\n\r\n7\r\nchunked\r\n0\r\n\r\n'

#x1B[1m#x1B[31mtests/test_http_parser.py#x1B[0m:1375: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31maiohttp/_http_parser.pyx#x1B[0m:558: in aiohttp._http_parser.HttpParser.feed_data
    #x1B[0m#x1B[94mraise#x1B[39;49;00m ex#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31maiohttp/_http_parser.pyx#x1B[0m:792: in aiohttp._http_parser.cb_on_chunk_header
    #x1B[0mpyparser._on_chunk_header()#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31maiohttp/_http_parser.pyx#x1B[0m:482: in aiohttp._http_parser.HttpParser._on_chunk_header
    #x1B[0m#x1B[96mself#x1B[39;49;00m._payload.begin_http_chunk_receiving()#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <EmptyStreamReader>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mbegin_http_chunk_receiving#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>       #x1B[94mif#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._http_chunk_splits #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       AttributeError: 'EmptyStreamReader' object has no attribute '_http_chunk_splits'#x1B[0m

self       = <EmptyStreamReader>

#x1B[1m#x1B[31maiohttp/streams.py#x1B[0m:292: AttributeError

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

Copy link

codspeed-hq bot commented Mar 17, 2025

CodSpeed Performance Report

Merging #10587 will not alter performance

Comparing Dreamsorcerer-patch-1 (2ec4060) with master (28832b8)

Summary

✅ 47 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant