Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/Prefs.cpp

Issue 29372702: Issue #4826 - Use latch to replace thread-sleeping in tests
Patch Set: Created Jan. 19, 2017, 5:56 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/Prefs.cpp
===================================================================
--- a/test/Prefs.cpp
+++ b/test/Prefs.cpp
@@ -151,7 +151,7 @@
filterEngine->SetPref("patternsbackupinterval", jsEngine->NewValue(48));
filterEngine->SetPref("subscriptions_autoupdate", jsEngine->NewValue(false));
- std::this_thread::sleep_for(std::chrono::milliseconds(100));
+ std::this_thread::sleep_for(std::chrono::milliseconds(100)); // RACE
Eric 2017/01/19 18:38:07 The race condition here can't be eliminated with a
ASSERT_FALSE(fileSystem->prefsContents.empty());
@@ -222,7 +222,7 @@
ASSERT_TRUE(filterEngine->GetPref("suppress_first_run_page")->AsBool());
filterEngine->SetPref("suppress_first_run_page", jsEngine->NewValue(false));
- std::this_thread::sleep_for(std::chrono::milliseconds(100));
+ std::this_thread::sleep_for(std::chrono::milliseconds(100)); // RACE
ASSERT_FALSE(fileSystem->prefsContents.empty());

Powered by Google App Engine
This is Rietveld