TickCountTest failed on Windows
http://dotnet-ci.cloudapp.net/job/dotnet_corefx/job/windows_nt_release_prtest/2762/consoleFull
05:28:29 System.Tests.EnvironmentTickCount.TickCountTest [FAIL]
05:28:29 Assert+WrapperXunitException : File path: d:\j\workspace\windows_nt_re---5067c899\src\System.Runtime.Extensions\tests\System\Environment.TickCount.cs. Line: 16
05:28:29 ---- Assert.True() Failure
05:28:29 Expected: True
05:28:29 Actual: False
05:28:29 Stack Trace:
05:28:29 d:\j\workspace\windows_nt_re---5067c899\src\Common\tests\System\Diagnostics\AssertWithCallerAttributes.cs(583,0): at Assert.WrapException(Exception e, String callerFilePath, Int32 callerLineNumber)
05:28:29 d:\j\workspace\windows_nt_re---5067c899\src\Common\tests\System\Diagnostics\AssertWithCallerAttributes.cs(578,0): at Assert.True(Boolean condition, String userMessage, String path, Int32 line)
05:28:29 ----- Inner Stack Trace -----
05:28:29 d:\j\workspace\windows_nt_re---5067c899\src\Common\tests\System\Diagnostics\AssertWithCallerAttributes.cs(571,0): at Assert.True(Boolean condition, String userMessage, String path, Int32 line)
http://dotnet-ci.cloudapp.net/job/dotnet_corefx/job/windows_nt_debug_prtest/3758/consoleFull
@stephentoub I wonder if this could be a case of TickCount overflowing as well? The code is like this:
int start = Environment.TickCount;
Assert.True(SpinWait.SpinUntil(() => Environment.TickCount > start, TimeSpan.FromSeconds(1)));
It seems like in some insanely rare scenario, the initial TickCount value could be somewhere near or equal to Int32.MaxValue, and all the rest of the reads (in the SpinWait) could have overflowed. Do we have such long-running Windows machines, as well?
Do we have such long-running Windows machines, as well?
We do.
Fixed by https://github.com/dotnet/corefx/pull/7868
This just failed again: http://dotnet-ci.cloudapp.net/job/dotnet_corefx/job/master/job/windows_nt_debug_prtest/1162/consoleText
System.Tests.EnvironmentTickCount.TickCountTest [FAIL]
Assert+WrapperXunitException : File path: D:\j\workspace\windows_nt_de---4526f5ff\src\System.Runtime.Extensions\tests\System\Environment.TickCount.cs. Line: 16
---- Assert.True() Failure
Expected: True
Actual: False
Stack Trace:
D:\j\workspace\windows_nt_de---4526f5ff\src\Common\tests\System\Diagnostics\AssertWithCallerAttributes.cs(583,0): at Assert.WrapException(Exception e, String callerFilePath, Int32 callerLineNumber)
D:\j\workspace\windows_nt_de---4526f5ff\src\Common\tests\System\Diagnostics\AssertWithCallerAttributes.cs(578,0): at Assert.True(Boolean condition, String userMessage, String path, Int32 line)
D:\j\workspace\windows_nt_de---4526f5ff\src\System.Runtime.Extensions\tests\System\Environment.TickCount.cs(16,0): at System.Tests.EnvironmentTickCount.TickCountTest()
----- Inner Stack Trace -----
D:\j\workspace\windows_nt_de---4526f5ff\src\Common\tests\System\Diagnostics\AssertWithCallerAttributes.cs(571,0): at Assert.True(Boolean condition, String userMessage, String path, Int32 line)
Again on June 5 - Windows 7 Debug Outerloop
System.Tests.EnvironmentTickCount.TickCountTest (from (empty))
MESSAGE:
Assert+WrapperXunitException : File path: d:\j\workspace\outerloop_win---b280fd23\src\System.Runtime.Extensions\tests\System\Environment.TickCount.cs. Line: 16\r\n---- Assert.True() Failure\r\nExpected: True\r\nActual: False
+++++++++++++++++++
STACK TRACE:
at Assert.WrapException(Exception e, String callerFilePath, Int32 callerLineNumber) at Assert.True(Boolean condition, String userMessage, String path, Int32 line) at System.Tests.EnvironmentTickCount.TickCountTest() ----- Inner Stack Trace ----- at Assert.True(Boolean condition, String userMessage, String path, Int32 line)
Looks like the server on which this was run has been up for 25 days, aka ~2^31 milliseconds and when Environment.TickCount wraps around.
Just failed again: http://dotnet-ci.cloudapp.net/job/dotnet_corefx/job/master/job/windows_nt_debug_prtest/308/consoleText
System.Tests.EnvironmentTickCount.TickCountTest [FAIL]
Assert+WrapperXunitException : File path: D:\j\workspace\windows_nt_de---4526f5ff\src\System.Runtime.Extensions\tests\System\Environment.TickCount.cs. Line: 19
---- TickCount did not increase after one second. start: 41731625, values tested: 41731625.
Expected: True
Actual: False
Stack Trace:
Condition(s) not met: "ECExplicitCurvesSupported"
D:\j\workspace\windows_nt_de---4526f5ff\src\Common\tests\System\Diagnostics\AssertWithCallerAttributes.cs(583,0): at Assert.WrapException(Exception e, String callerFilePath, Int32 callerLineNumber)
D:\j\workspace\windows_nt_de---4526f5ff\src\Common\tests\System\Diagnostics\AssertWithCallerAttributes.cs(578,0): at Assert.True(Boolean condition, String userMessage, String path, Int32 line)
D:\j\workspace\windows_nt_de---4526f5ff\src\System.Runtime.Extensions\tests\System\Environment.TickCount.cs(19,0): at System.Tests.EnvironmentTickCount.TickCountTest()
----- Inner Stack Trace -----
D:\j\workspace\windows_nt_de---4526f5ff\src\Common\tests\System\Diagnostics\AssertWithCallerAttributes.cs(575,0): at Assert.True(Boolean condition, String userMessage, String path, Int32 line)
Failed for me as well. Innerloop Windows_NT Debug Build and Test https://ci.dot.net/job/dotnet_corefx/job/master/job/windows_nt_debug_prtest/1764/consoleText System.Tests.EnvironmentTickCount.TickCountTest [FAIL]
TickCount did not increase after one second. start: 4711531, values tested: 4711531.
Expected: True
Actual: False
Stack Trace:
Condition(s) not met: \"ECExplicitCurvesSupported\"
D:\j\workspace\windows_nt_de---4526f5ff\src\System.Runtime.Extensions\tests\System\Environment.TickCount.cs(19,0): at System.Tests.EnvironmentTickCount.TickCountTest()`
@stephentoub In the failures it looks like we usually have only read one value in the SpinWait block, and never got a chance to read another value, due to bad scheduling luck. Maybe we should read once again after the SpinWait?
Maybe we should read once again after the SpinWait?
Sounds reasonable.