Commit 58463573 by Jamie Madill Committed by Commit Bot

Test Runner: Fix dirty thread teardown.

When the standalone tests shut down they would not wait for the watchdog thread to exit cleanly. Fix this by setting a flag that shuts down the watchdog and attempting to wait. This was detected by running angle_end2end_tests with TSAN. Bug: angleproject:3162 Bug: b/168744561 Change-Id: I765ce7a21c3be11703619470a81adb1882b009e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2415175 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent a2d670c5
...@@ -1160,7 +1160,20 @@ int TestSuite::run() ...@@ -1160,7 +1160,20 @@ int TestSuite::run()
if (!mBotMode) if (!mBotMode)
{ {
startWatchdog(); startWatchdog();
return RUN_ALL_TESTS(); int retVal = RUN_ALL_TESTS();
{
std::lock_guard<std::mutex> guard(mTestResults.currentTestMutex);
mTestResults.allDone = true;
}
for (int tries = 0; tries < 10; ++tries)
{
if (!mWatchdogThread.joinable())
break;
angle::Sleep(100);
}
return retVal;
} }
Timer totalRunTime; Timer totalRunTime;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment