Attempt to fix the 32 bit fd_monitor test

Speculatively the fd_monitor thread is not scheduled, or we are awoken
early. Add a loop to ensure it gets run.

This is an attempt at #7699
This commit is contained in:
ridiculousfish 2021-02-10 11:46:28 -08:00
parent 2bab31a316
commit f239329f33

View File

@ -868,7 +868,14 @@ static void test_fd_monitor() {
item42_thenclose.writer.close();
item_oneshot.write42();
monitor.poke_item(item_pokee.item_id);
// May need to loop here to ensure our fd_monitor gets scheduled - see #7699.
for (int i = 0; i < 100; i++) {
std::this_thread::sleep_for(std::chrono::milliseconds(84));
if (item0_timeout.did_timeout) {
break;
}
}
}
do_test(!item_never.did_timeout);