mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00: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
1 changed files with 8 additions and 1 deletions
|
@ -868,7 +868,14 @@ static void test_fd_monitor() {
|
|||
item42_thenclose.writer.close();
|
||||
item_oneshot.write42();
|
||||
monitor.poke_item(item_pokee.item_id);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(84));
|
||||
|
||||
// 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);
|
||||
|
|
Loading…
Reference in a new issue