From 1df44df0571f22c4221e783c13ccd6208db274d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Mon, 14 Oct 2019 23:05:07 +0200 Subject: [PATCH] darwin,test: update loop time after sleeping Otherwise we run the risk of running the timer before the fsevent callback since the timer due time is "now" because it's as long as the process already slept. Refs: https://github.com/libuv/libuv/issues/2491 PR-URL: https://github.com/libuv/libuv/pull/2516 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- test/test-fs-event.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test-fs-event.c b/test/test-fs-event.c index a6a7a81b..e694d258 100644 --- a/test/test-fs-event.c +++ b/test/test-fs-event.c @@ -638,6 +638,7 @@ TEST_IMPL(fs_event_watch_file_exact_path) { * versions. Give a long delay here to let the system settle before running * the test. */ uv_sleep(1100); + uv_update_time(loop); #endif r = uv_fs_event_init(loop, &fs_event); @@ -703,6 +704,7 @@ TEST_IMPL(fs_event_watch_file_current_dir) { * create_file events prior to macOS 10.11.6 in the subsequent fs_event_start * So let the system settle before running the test. */ uv_sleep(1100); + uv_update_time(loop); #endif r = uv_fs_event_init(loop, &fs_event);