Repository navigation
Closed
dotnet/corefx
#7937Description
System.Net.Security.Tests.SslStreamStreamToStreamTest.SslStream_StreamToStream_Authentication_Success [FAIL]
Handshake completed in the allotted time
Expected: True
Actual: False
Stack Trace:
d:\j\workspace\dotnet_corefx_windows_release_prtest\src\System.Net.Security\tests\FunctionalTests\SslStreamStreamToStreamTest.cs(36,0): at System.Net.Security.Tests.SslStreamStreamToStreamTest.SslStream_StreamToStream_Authentication_Success()
System.Net.Security.Tests.CertificateValidationClientServer.CertificateValidationClientServer_EndToEnd_Ok [FAIL]
Client/Server Authentication timed out.
Expected: True
Actual: False
Stack Trace:
d:\j\workspace\dotnet_corefx_windows_release_prtest\src\System.Net.Security\tests\FunctionalTests\CertificateValidationClientServer.cs(80,0): at System.Net.Security.Tests.CertificateValidationClientServer.<CertificateValidationClientServer_EndToEnd_Ok>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Net.Security.Tests.ClientAsyncAuthenticateTest.ClientAsyncAuthenticate_EachProtocol_Success [FAIL]
Timed Out
Expected: True
Actual: False
Stack Trace:
d:\j\workspace\dotnet_corefx_windows_release_prtest\src\System.Net.Security\tests\FunctionalTests\ClientAsyncAuthenticateTest.cs(252,0): at System.Net.Security.Tests.ClientAsyncAuthenticateTest.<ClientAsyncSslHelper>d__5c.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
d:\j\workspace\dotnet_corefx_windows_release_prtest\src\System.Net.Security\tests\FunctionalTests\ClientAsyncAuthenticateTest.cs(108,0): at System.Net.Security.Tests.ClientAsyncAuthenticateTest.<ClientAsyncAuthenticate_EachProtocol_Success>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Activity
CIPop commentedon Nov 12, 2015
/cc @markwilkie
We're already at 10s for these tests. I'll increase to 15s but, unless this is a product bug, this is simply showing that the CI system boxes are not scaling for the number of concurrent tests that they need to run.
CIPop commentedon Nov 12, 2015
For reference: on my system, the entire System.Net.Security test suite executes in about 1 second.
stephentoub commentedon Nov 12, 2015
@CIPop, I expect you're right, but should we also consider the possibility that there's a race condition / deadlock somewhere and these timeouts actually represent a real product issue? Or is that not possible?
CIPop commentedon Nov 13, 2015
I'm not disregarding that possibility. If this happens after I increase the timeouts, I'll see if I can repro in my own environment or if I can add memory-dump generation code to the tests (i.e. a call to MiniDumpWriteDump ).
Removing SSLv2 and SSLv3 support from System.Net.Security.
stephentoub commentedon Nov 13, 2015
Same three failed here: dotnet/corefx#4478 (comment)
stephentoub commentedon Nov 13, 2015
And again here: http://dotnet-ci.cloudapp.net/job/dotnet_corefx_windows_release_prtest/6163/
stephentoub commentedon Nov 15, 2015
Again here:
http://dotnet-ci.cloudapp.net/job/dotnet_corefx_windows_debug/1777/console
stephentoub commentedon Nov 16, 2015
Again here:
http://dotnet-ci.cloudapp.net/job/dotnet_corefx_windows_release_prtest/6224/
Removing SSLv2 and SSLv3 support from System.Net.Security.
CIPop commentedon Nov 16, 2015
Increased the timeouts to 15s.
If this is still noticed we'll need to try to repro on a system that can be debugged and ETW can be collected. #15570 is preventing us from using the CI failures for investigation.
CIPop commentedon Nov 16, 2015
Please reopen this issue if the errors still show up in CI.
It would be interesting to understand if the timeouts decreased the frequency of this failure.
stephentoub commentedon Nov 16, 2015
When? This has been reproing fairly regularly for the last few days, in fact I'd say the regularity has actually increased.
They're not going to as I disabled them yesterday in dotnet/corefx#4526 due to how many PRs they were taking out.
38 remaining items
justinvp commentedon Apr 15, 2016
Again here:
http://dotnet-ci.cloudapp.net/job/dotnet_corefx/job/windows_nt_debug_prtest/5002/
stephentoub commentedon Apr 17, 2016
Again here:
http://dotnet-ci.cloudapp.net/job/dotnet_corefx/job/master/job/outerloop_win7_debug/3/
davidsh commentedon Apr 17, 2016
Just a thought...but maybe with PR dotnet/corefx#7800, these timeouts might go away?
stephentoub commentedon Apr 18, 2016
Certainly possible. It's been merged. We'll see if we continue to hit occurrences of this.
CIPop commentedon Apr 25, 2016
After all fixes I was not able to repro this in my environment.
On machines with low CPU resources, a smaller timeout will cause this issue. If that's the case, we'll need to increase the current setting of 1 minute timeout for passing tests.
The current timeout has been verified to work on a 12 CPU box with 100 parallel tests and 2/8CPU VMs with 20 parallel tests.
CIPop commentedon Dec 6, 2016
@karelz PTAL
karelz commentedon Dec 6, 2016
Long thread, what's the summary I should look at?
What I am interested:
CIPop commentedon Dec 6, 2016
SslStream tests were intermittently failing.
The tests are not written to support multiple executions in parallel. We should write proper stress/perf tests for that purpose.
On a normal dev station this is not observed unless the machine is very busy. In CI, I've been told that it's common for the machine to be busy executing multiple requests on the same system.
See my last comment above:
After increasing the timeout I haven't seen failures.
This has been fixed since April 25th.
The fix at that time was to increase the timeout. Another potential fix was to run the tests on a machine with less CPU/network stress.
This is applicable to most intermittent network timeouts logged by the CI system.
It is theoretically possible but I wouldn't expect contributors to model the CI system and come up with the right timeout.
karelz commentedon Dec 7, 2016
What kind of failure(s)? Timeouts? Something else?
What does it mean? Do they have shared state? Or do they have hardcoded timeouts which are too short for 'busy machines'?
And that's a problem of the test having too aggressive expectations, it should have some room for busy machines / slow VMs / etc. Not unreasonably large timeouts, but still some room to accommodate for differences.
What about a general timeout expression like 15s + 10 * (test_duration_on_fast_machine). The constants are of course tweakable.
I meant: How common is the problematic pattern (too aggressive timeout) in all tests? Is it one off? Rare? Common? Majority?
Reasonable timeout is the right fix. We should not force every developer / CI system to run on exclusive CPU/network. Again, we should be reasonable with the timeout allowances.
Is there some smart/easy way how to discover all such tests? Or change them all at once?
I don't follow. It should be us doing the sweep and "cleaning up" our tests, right? I wasn't suggesting enlisting contributors to do our dirty laundry :)
CIPop commentedon Dec 7, 2016
@karelz It's probably simpler if you go through the issue and the PR to answer most of your questions or we have an offline discussion to clarify more.
I'll try to summarize here: SslStream was failing with timeouts (as the title suggests). This is expected in any service/application running on a machine running out of resources (CPU, RAM, I/O), as it reaches the threshold where the overall performance will start to decay if more operations are queued. Network, Windows services (lsass for TLS in this case), CPU and RAM are the shared resources. Another resource is Azure itself which has, by SLA, 99.9% availability (the VM stability itself).
Definitely not: what I'm saying is quite the opposite. We can't expect developers that don't have access to CI machines or specs to write a test that runs just fine on their dev machine but will fail in CI running out of resources. It's hard to write and test code that scales correctly. Fixing the test code to run in parallel with multiple instances of itself in a heavily constrained CI system would basically enlist contributors to do the heavy lifting for each test, even if it's not a stress/perf test expected to reach the limits of the system.
I agree (see my comment in #15381).
One problem is that the "CI tuning" process was iterative and involved me running the tests with different values over and over again in CI and using my simulation script (which itself had to be tuned to simulate the CI system on my dev box): dotnet/corefx#7937. Another problem is that as we're adding new tests, the CI system is more likely to run out of resources as several builds/tests are running in parallel on the same VM. Because of this, the system will become loaded in a different way which the likelihood of time-sensitive tests to exhibit different failure-modes.
The next step or an alternative to make the system even more tolerant to timeouts would be a retry mechanism for everything involving network (#3697). There are downsides here:
karelz commentedon Dec 7, 2016
Sounds good to me
Yep, and that's exactly why timeouts should not be too tight. They should expect other normal operations on the system.
That is relevant only for tests hitting Azure servers. Is that the case here -- that is vital information and the reason why we need proper write up on the failures and root-causes and not just links to GH issues where the information is scattered across large discussions.
Why can't we just time the test on normal machine (or guess) and then apply something like "15s + 10 * (test_duration_on_fast_machine)" to determine the timeout?
That sounds like a lot of work and it pollutes the tests if I understand it correctly. I would start with cheaper solutions first (buffering timeouts).