Skip to content

Commit

Permalink
Watcher tests - disable flaky test on Windows + Linux
Browse files Browse the repository at this point in the history
Summary:
Despite increasing timeouts for this test a few times, we still see failures both in OSS and internal CI.

I'm pretty sure there's a race condition in both our own `FallbackWatcher` / `NodeWatcher` *and* Watchman where when recursively watching a subtree, new files are added before a directory is watched or crawled, and so we never see an event for them.

This is a problem, but I don't want to entirely lose the signal for this important set of tests due to that flakiness. This skips the problematic test on Windows and Linux until we have a better fix. We haven't observed a problem on macOS IIRC.

Changelog: Internal

Reviewed By: huntie

Differential Revision: D67712965

fbshipit-source-id: 2246d282f7edba8243a4e8922fea13137959cc3f
  • Loading branch information
robhogan authored and facebook-github-bot committed Dec 31, 2024
1 parent 11a1f97 commit 9518c0e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ describe.each(Object.keys(WATCHERS))(

// If all tests are skipped, Jest will not run before/after hooks either.
const maybeTest = WATCHERS[watcherName] ? test : test.skip;
const maybeTestOn = (...platforms: $ReadOnlyArray<string>) =>
platforms.includes(os.platform()) ? test : test.skip;

beforeAll(async () => {
watchRoot = await createTempWatchRoot(watcherName);
Expand Down Expand Up @@ -233,7 +235,9 @@ describe.each(Object.keys(WATCHERS))(
});
});

maybeTest(
/* FIXME: Disabled on Windows and Darwin due to flakiness (occasional
timeouts) - see history. */
maybeTestOn('darwin')(
'emits deletion for all files when a directory is deleted',
async () => {
await eventHelpers.allEvents(
Expand Down Expand Up @@ -267,8 +271,6 @@ describe.each(Object.keys(WATCHERS))(
{rejectUnexpected: true},
);
},
// We see occasional failures in CI with default 5s timeout.
45000,
);
},
);

0 comments on commit 9518c0e

Please sign in to comment.