You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After #91530 refactored some condvar tests to pass reliably, @Arup-Chauhan helped MSVC's STL by re-enabling the condvar tests that we had been skipping (microsoft/STL#4721). However, our CI system immediately encountered sporadic failures in thread.condition.condvar/notify_all.pass.cpp. #91530 didn't change that test, so this isn't new, we just didn't realize this had a distinct cause until the other tests were fixed.
The assertions we saw (on different test runs) were:
Assertion failed: test1 == 0, file D:\a\_work\1\s\llvm-project\libcxx\test\std\thread\thread.condition\thread.condition.condvar\notify_all.pass.cpp, line 35
Assertion failed: test2 == 0, file D:\a\_work\1\s\llvm-project\libcxx\test\std\thread\thread.condition\thread.condition.condvar\notify_all.pass.cpp, line 45
The test code is clearly using sleep_for 100ms as a synchronization primitive:
Under heavy load, it's entirely possible for the new threads t1 and t2 running f1 and f2 respectively to not get started before the main thread gets through its 100ms sleep, acquires mut, and sets test1 and test2 to 1. This causes f1 and f2 to assert when they discover this.
A deterministic mechanism needs to be used here.
The text was updated successfully, but these errors were encountered:
After #91530 refactored some condvar tests to pass reliably, @Arup-Chauhan helped MSVC's STL by re-enabling the condvar tests that we had been skipping (microsoft/STL#4721). However, our CI system immediately encountered sporadic failures in
thread.condition.condvar/notify_all.pass.cpp
. #91530 didn't change that test, so this isn't new, we just didn't realize this had a distinct cause until the other tests were fixed.The assertions we saw (on different test runs) were:
The test code is clearly using
sleep_for
100ms as a synchronization primitive:llvm-project/libcxx/test/std/thread/thread.condition/thread.condition.condvar/notify_all.pass.cpp
Lines 32 to 35 in 3eb4128
llvm-project/libcxx/test/std/thread/thread.condition/thread.condition.condvar/notify_all.pass.cpp
Lines 42 to 45 in 3eb4128
llvm-project/libcxx/test/std/thread/thread.condition/thread.condition.condvar/notify_all.pass.cpp
Lines 52 to 61 in 3eb4128
Under heavy load, it's entirely possible for the new threads
t1
andt2
runningf1
andf2
respectively to not get started before themain
thread gets through its 100ms sleep, acquiresmut
, and setstest1
andtest2
to1
. This causesf1
andf2
to assert when they discover this.A deterministic mechanism needs to be used here.
The text was updated successfully, but these errors were encountered: