runtime icon indicating copy to clipboard operation
runtime copied to clipboard

[Linux] HttpClient test SendAsync_ReadFromSlowStreamingServer_PartialDataReturned failed

Open davidsh opened this issue 11 years ago • 10 comments

Reference new PR dotnet/corefx#4255 Build: http://dotnet-ci.cloudapp.net/job/dotnet_corefx_prtest/6065/

New test added: test failed on Linux: System.Net.Http.Functional.Tests.HttpClientHandlerTest.SendAsync_ReadFromSlowStreamingServer_PartialDataReturned

"bytesRead should be less than buffer.Length Expected: True Actual: False"

davidsh avatar Oct 30 '15 03:10 davidsh

/cc: @stephentoub @vijaykota

davidsh avatar Oct 30 '15 03:10 davidsh

cc: @kapilash PTAL

vijaykota avatar Oct 30 '15 04:10 vijaykota

Checked behavior with curl http://httpbin.org/drip?numbytes=8192. That also returns the complete response of 8192 bytes so looks like a libcurl vs Winhttp nuance we need to dig into. Moving to RTM since this shouldn't block RC1.

vijaykota avatar Nov 02 '15 10:11 vijaykota

Paste error in URL: http://httpbin.org/drip?numbytes=8192&duration=15&delay=1&code=200 is the url used in the testcase (and which succeeds with curl)

vijaykota avatar Nov 02 '15 10:11 vijaykota

(See my comments on the PR here https://github.com/dotnet/corefx/pull/4255)

stephentoub avatar Nov 02 '15 14:11 stephentoub

We have analysed this issue by enabling logging & xplat code is working as expected i.e. ReadAsync is indeed returning when it's getting the first set of bytes in CurlReceiveHeadersCallback rather than blocking it. That is clearly visible from log analysis coupled with bytesRead value.

Why it failed sometimes in CI or in Kapilash setup? This looks very much like what @stephentoub have already mentioned.i.e. possible network delay or some sort of random delay might explain this. On my setup it passed >30 times & did not fail a single time. Looks like the tests need to be made more reliable. To re-affirm this, we ran the same test on windows, but introduced a delay of 5 second between ReadAsStreamAsync() & ReadAsync(buffer, 0, buffer.Length) & the test failed because it read the complete 8192 bytes by that time. Same might be happening in those failure cases if there is some delay somewhere during execution.

Conclusion This does not looks like any curl or xplat related code bug. Test need to be made more reliable.

rajansingh10 avatar Nov 18 '15 15:11 rajansingh10

@joshfree, please reassign this. This needs a fix in the test case rather than any changes in the xplat implementation

vijaykota avatar Jan 27 '16 05:01 vijaykota

You may also want to evaluate if it is required for RTM

vijaykota avatar Jan 27 '16 05:01 vijaykota

I will assign this to myself to consider any design issues in the test case itself.

davidsh avatar Jan 27 '16 05:01 davidsh

Thanks for taking this up, @davidsh

vijaykota avatar Jan 27 '16 09:01 vijaykota