diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index 2bbc0fd79..933afe96b 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -3867,6 +3867,12 @@ static void test_notifiers_with_strategy(universal_notifier_t::notifier_strategy // Nobody should poll now. for (size_t i = 0; i < notifier_count; i++) { + // On BSD, SIGIO may be delivered by read() even if it returns EAGAIN; + // that is the polling itself may trigger a SIGIO. Therefore we poll twice. + if (strategy == universal_notifier_t::strategy_sigio) { + (void)poll_notifier(notifiers[i]); + } + if (poll_notifier(notifiers[i])) { err(L"Universal variable notifier polled true after all changes, with strategy %d", (int)strategy);