[Linux] HttpClient test SendAsync_ReadFromSlowStreamingServer_PartialDataReturned failed
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"
/cc: @stephentoub @vijaykota
cc: @kapilash PTAL
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.
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)
(See my comments on the PR here https://github.com/dotnet/corefx/pull/4255)
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.
@joshfree, please reassign this. This needs a fix in the test case rather than any changes in the xplat implementation
You may also want to evaluate if it is required for RTM
I will assign this to myself to consider any design issues in the test case itself.
Thanks for taking this up, @davidsh