Test fails with buggify on sometimes because of injected delays in run loop, so test now waits for each future to become ready regardless of delay.
This commit is contained in:
parent
09b0c1c419
commit
765d94c6b3
|
@ -1581,26 +1581,18 @@ TEST_CASE("/flow/flow/FlowMutex") {
|
|||
}
|
||||
error = e;
|
||||
|
||||
// Wait for all actors still running to finish their waits and try to take the mutex
|
||||
// Some actors can still be running, waiting while locked or unlocked,
|
||||
// but all should become ready, some with errors.
|
||||
state int i;
|
||||
if (verbose) {
|
||||
printf("Waiting for completions\n");
|
||||
printf("Waiting for completions. Future end states:\n");
|
||||
}
|
||||
wait(delay(2 * mutexTestDelay));
|
||||
|
||||
if (verbose) {
|
||||
printf("Future end states:\n");
|
||||
}
|
||||
// All futures should be ready, some with errors.
|
||||
bool allReady = true;
|
||||
for (int i = 0; i < tests.size(); ++i) {
|
||||
auto f = tests[i];
|
||||
for (i = 0; i < tests.size(); ++i) {
|
||||
ErrorOr<Void> f = wait(errorOr(tests[i]));
|
||||
if (verbose) {
|
||||
printf(
|
||||
" %d: %s\n", i, f.isReady() ? (f.isError() ? f.getError().what() : "done") : "not ready");
|
||||
printf(" %d: %s\n", i, f.isError() ? f.getError().what() : "done");
|
||||
}
|
||||
allReady = allReady && f.isReady();
|
||||
}
|
||||
ASSERT(allReady);
|
||||
}
|
||||
|
||||
// If an error was caused, one should have been detected.
|
||||
|
|
Loading…
Reference in New Issue