1
0
mirror of https://github.com/libuv/libuv synced 2025-03-28 21:13:16 +00:00

test: unflake fs_event_watch_dir test (#3863)

Increase the timer interval. That hopefully ameliorates the problem of
FSEvents.framework missing events on the macOS CI buildbot.

Not really a fix, more a mitigation.

Fixes: https://github.com/libuv/libuv/issues/3862
This commit is contained in:
Ben Noordhuis 2022-12-21 07:51:50 +01:00 committed by GitHub
parent a3de1384c3
commit d5cfb89959
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,12 +39,6 @@
# endif
#endif
#if defined(__arm__)/* Increase the timeout so the test passes on arm CI bots */
# define CREATE_TIMEOUT 100
#else
# define CREATE_TIMEOUT 1
#endif
static uv_fs_event_t fs_event;
static const char file_prefix[] = "fsevent-";
static const int fs_event_file_count = 16;
@ -162,10 +156,7 @@ static void fs_event_create_files(uv_timer_t* handle) {
if (++fs_event_created < fs_event_file_count) {
/* Create another file on a different event loop tick. We do it this way
* to avoid fs events coalescing into one fs event. */
ASSERT(0 == uv_timer_start(&timer,
fs_event_create_files,
CREATE_TIMEOUT,
0));
ASSERT_EQ(0, uv_timer_start(&timer, fs_event_create_files, 100, 0));
}
}
@ -241,7 +232,8 @@ static void fs_event_create_files_in_subdir(uv_timer_t* handle) {
if (++fs_event_created < fs_event_file_count) {
/* Create another file on a different event loop tick. We do it this way
* to avoid fs events coalescing into one fs event. */
ASSERT(0 == uv_timer_start(&timer, fs_event_create_files_in_subdir, 1, 0));
ASSERT_EQ(0,
uv_timer_start(&timer, fs_event_create_files_in_subdir, 100, 0));
}
}