mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
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:
parent
2bab31a316
commit
f239329f33
|
@ -868,7 +868,14 @@ static void test_fd_monitor() {
|
||||||
item42_thenclose.writer.close();
|
item42_thenclose.writer.close();
|
||||||
item_oneshot.write42();
|
item_oneshot.write42();
|
||||||
monitor.poke_item(item_pokee.item_id);
|
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));
|
std::this_thread::sleep_for(std::chrono::milliseconds(84));
|
||||||
|
if (item0_timeout.did_timeout) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
do_test(!item_never.did_timeout);
|
do_test(!item_never.did_timeout);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user