Commit c21a0011 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook GitHub Bot

Fix flakey test

Summary: Fix flakey test

Reviewed By: kevin-vigor

Differential Revision: D26090290

fbshipit-source-id: f03d6abf389815993e8742d5c27c2ccbcb13949a
parent 3aa8f275
......@@ -2236,15 +2236,19 @@ TYPED_TEST_P(EventBaseTest1, DrivableExecutorTest) {
folly::EventBase& base = *eventBasePtr;
bool finished = false;
Baton baton;
std::thread t([&] {
baton.wait();
/* sleep override */
std::this_thread::sleep_for(std::chrono::microseconds(10));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
finished = true;
base.runInEventBaseThread([&]() { p.setValue(true); });
});
// Ensure drive does not busy wait
base.drive(); // TODO: fix notification queue init() extra wakeup
baton.post();
base.drive();
EXPECT_TRUE(finished);
......
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