Skip to content

tr1/tests/thread is sporadically failing #1642

Description

#1627 encountered a sporadic failure in the legacy tr1 test suite. The failure log was:

Build setup steps:
Build steps:
Command: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29812\bin\HostX64\x64\cl.EXE" "C:\a\1\s\tests\tr1\tests\thread\test.cpp" "-ID:\build\out\inc" "-IC:\a\1\s\tests\tr1\include" "-IC:\a\1\s\tests\std\include" "/nologo" "/Od" "/W4" "/w14061" "/w14242" "/w14265" "/w14582" "/w14583" "/w14587" "/w14588" "/w14749" "/w14841" "/w14842" "/w15038" "/w15214" "/w15215" "/w15216" "/w15217" "/sdl" "/WX" "/Zc:strictStrings" "/D_ENABLE_STL_INTERNAL_CHECK" "/bigobj" "/FIforce_include.hpp" "/D_ENFORCE_FACET_SPECIALIZATIONS=1" "/D_CRT_SECURE_NO_WARNINGS" "/Za" "/EHsc" "/MD" "/std:c++latest" "/permissive-" "-FeD:\build\tests\tr1\tests\thread\Output\14\thread.exe" "-link" "-LIBPATH:D:\build\out\lib\amd64" "-LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29812\lib\x64" "/MANIFEST:EMBED"
Exit Code: 0
Standard Output:
--
test.cpp

--

Intellisense response file steps:
Test setup steps:
Test steps:
Test step failed unexpectedly.
Command: "D:\build\tests\tr1\tests\thread\Output\14\thread.exe"
Exit Code: 1
Standard Output:
--
__STDCPP_THREADS__ = <1>

 GOT 0 != 1

 FAIL test 113 at line 336 in C:\a\1\s\tests\tr1\tests\thread\test.cpp: tgt <= STD chrono::system_clock::now() == true

FINISHED testing <thread>

***** 1 erroneous test cases in <thread> *****

***** 113 successful test cases in <thread> *****

#FAILED: <thread>

--

Code:

{
STD chrono::system_clock::duration dur = STD chrono::system_clock::duration(100);
STD chrono::system_clock::time_point tgt = STD chrono::system_clock::now() + dur;
STD this_thread::sleep_for(dur);
CHECK_INT(tgt <= STD chrono::system_clock::now(), true);
dur = -dur;
tgt = STD chrono::system_clock::now() + dur;
STD this_thread::sleep_for(dur);
CHECK_INT(tgt <= STD chrono::system_clock::now(), true);
}

Sporadic failures are doom. We should either fix this test to behave reliably, or skip it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolvedSuccessfully resolved without a committestRelated to test code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions