This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Reset global variables in ThreadRegistryThreadedTest
ClosedPublic

Authored by etienneb on Jun 29 2016, 10:26 PM.

Details

Summary

The unittest 'ThreadRegistryThreadedTest' is failing when running in loop.
There are global variables that need to be cleared.

To repro:

projects\compiler-rt\lib\sanitizer_common\tests\Release\Sanitizer-x86_64-Test.exe --gtest_filter=SanitizerCommon.ThreadRegistryThreadedTest  --gtest_repeat=2

Output:

Repeating all tests (iteration 1) . . .

Note: Google Test filter = SanitizerCommon.ThreadRegistryThreadedTest
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from SanitizerCommon
[ RUN      ] SanitizerCommon.ThreadRegistryThreadedTest
[       OK ] SanitizerCommon.ThreadRegistryThreadedTest (1 ms)
[----------] 1 test from SanitizerCommon (1 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (2 ms total)
[  PASSED  ] 1 test.

Repeating all tests (iteration 2) . . .

Note: Google Test filter = SanitizerCommon.ThreadRegistryThreadedTest
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from SanitizerCommon
[ RUN      ] SanitizerCommon.ThreadRegistryThreadedTest
C:/src/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc(216): error: Value of: num_created[0]
  Actual: 2
Expected: 1
C:/src/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc(217): error: Value of: num_started[0]
  Actual: 2
Expected: 1
C:/src/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc(220): error: Value of: num_created[i]
[...]
[  FAILED  ] SanitizerCommon.ThreadRegistryThreadedTest (294 ms)
[----------] 1 test from SanitizerCommon (294 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (299 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] SanitizerCommon.ThreadRegistryThreadedTest

 1 FAILED TEST

Diff Detail

Event Timeline

etienneb updated this revision to Diff 62336.Jun 29 2016, 10:26 PM
etienneb retitled this revision from to [compiler-rt] Reset global variables in ThreadRegistryThreadedTest.
etienneb updated this object.
etienneb added a reviewer: rnk.
rnk accepted this revision.Jun 30 2016, 7:34 AM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.Jun 30 2016, 7:34 AM
etienneb closed this revision.Jun 30 2016, 7:44 AM