Fix TSAN warning with work.eco_pow (#1893)

This commit is contained in:
Wesley Shillingford 2019-04-12 14:57:59 +01:00 committed by GitHub
commit e63a5bdf89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -180,10 +180,10 @@ TEST (work, eco_pow)
std::thread thread1 (work_func, std::ref (promise1), std::chrono::nanoseconds (0));
std::thread thread2 (work_func, std::ref (promise2), std::chrono::milliseconds (10));
thread1.join ();
thread2.join ();
// Confirm that the eco pow rate limiter is working.
// It's possible under some unlucky circumstances that this fails to the random nature of valid work generation.
ASSERT_LT (future1.get (), future2.get ());
thread1.join ();
thread2.join ();
}