diff --git a/devel/src/wtr/test_watcher/test_new_directories.cpp b/devel/src/wtr/test_watcher/test_new_directories.cpp index 1949aa2a..5f6652ec 100644 --- a/devel/src/wtr/test_watcher/test_new_directories.cpp +++ b/devel/src/wtr/test_watcher/test_new_directories.cpp @@ -38,8 +38,7 @@ TEST_CASE("New Directories", "[test][dir][watch-target][not-perf]") REQUIRE(fs::exists(tmpdir) || fs::create_directory(tmpdir)); - /* @todo - This sleep is hiding a bug on darwin which picks + /* This sleep is hiding a bug on darwin which picks up events slightly before we start watching. I'm ok with that bit of wiggle-room. */ std::this_thread::sleep_for(100ms); @@ -110,6 +109,14 @@ TEST_CASE("New Directories", "[test][dir][watch-target][not-perf]") std::this_thread::sleep_for(10ms); + /* And give the watchers some room to await the events so far */ + for (int i = 0;; i++) { + std::this_thread::sleep_for(10ms); + auto _ = std::scoped_lock{event_recv_list_mtx}; + if (event_sent_list.size() == event_recv_list.size()) break; + if (i > 1000) REQUIRE(! "Timeout: Waited more than one second for results"); + } + event_sent_list.push_back( {std::string("s/self/die@").append(tmpdir.string()), event::effect_type::destroy,