Commit f91bed86 authored by Kenton Varda's avatar Kenton Varda

Improve reliability of xthread cancellation test.

parent b98b31ac
......@@ -338,16 +338,17 @@ KJ_TEST("cancel cross-thread event while it runs") {
exec = &KJ_ASSERT_NONNULL(*lock);
}
volatile bool called = false;
{
volatile bool called = false;
Promise<uint> promise = exec->executeAsync([&]() -> kj::Promise<uint> {
called = true;
return kj::NEVER_DONE;
});
delay();
while (!called) {
delay();
}
KJ_EXPECT(!promise.poll(waitScope));
}
KJ_EXPECT(called);
exec->executeSync([&]() { fulfiller->fulfill(); });
......
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