Skip to content

Use Sync Send methods in Sync HttpClient tests - #93139

Merged
MihaZupan merged 4 commits into
dotnet:mainfrom
MihaZupan:http-sync-tests
Oct 10, 2023
Merged

MihaZupan merged 4 commits into
dotnet:mainfrom
MihaZupan:http-sync-tests

Conversation

@MihaZupan

Copy link
Copy Markdown
Member

Updated a few existing tests that weren't propagating the TestAsync flag through and would always test the async paths.

Also increased the timeout on GetAsync_ResponseHasNormalLineEndings_Success because AFAICT, the test isn't actually getting stuck, but can just take a long time to execute on busy machines.
In these logs, you can see how bytes were slowly being sent through, but sometimes with ~20-second delays (the test is sending the response one byte at a time).
Contributes to #76678 (I'll keep an eye on CI to see if this decreases the number of times we're retrying this test).

[19.0790] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[19.0960] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 47
[19.0964] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[20.0123] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 4D
[20.0128] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[24.0540] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[24.0541] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 54
[24.0638] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[24.0639] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 0D
[24.0671] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 0A
[24.0671] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[47.0215] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 53
[47.0216] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[47.0320] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.

@ghost

ghost commented Oct 6, 2023

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Updated a few existing tests that weren't propagating the TestAsync flag through and would always test the async paths.

Also increased the timeout on GetAsync_ResponseHasNormalLineEndings_Success because AFAICT, the test isn't actually getting stuck, but can just take a long time to execute on busy machines.
In these logs, you can see how bytes were slowly being sent through, but sometimes with ~20-second delays (the test is sending the response one byte at a time).
Contributes to #76678 (I'll keep an eye on CI to see if this decreases the number of times we're retrying this test).

[19.0790] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[19.0960] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 47
[19.0964] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[20.0123] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 4D
[20.0128] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[24.0540] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[24.0541] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 54
[24.0638] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[24.0639] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 0D
[24.0671] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 0A
[24.0671] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[47.0215] [Sockets/DumpBuffer] thisOrContextObject: AwaitableSocketAsyncEventArgs#44062838, memberName: LogBuffer, buffer: 53
[47.0216] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
[47.0320] [Http/HandlerMessage] poolId: 30383028, workerId: 32561634, requestId: 50430218, memberName: FillAsync, message: Received 1 bytes.
Author: MihaZupan
Assignees: MihaZupan
Labels:

area-System.Net.Http

Milestone: -

@wfurt wfurt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MihaZupan
MihaZupan merged commit 53830e2 into dotnet:main Oct 10, 2023
@karelz karelz added this to the 9.0.0 milestone Oct 11, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 10, 2023
@antonfirsov antonfirsov added the test-enhancement Improvements of test source code label Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Net.Http test-enhancement Improvements of test source code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants