Increase FileSystemWatcher test event timeout to 1000ms#125744
Merged
lewing merged 1 commit intodotnet:mainfrom Mar 19, 2026
Merged
Increase FileSystemWatcher test event timeout to 1000ms#125744lewing merged 1 commit intodotnet:mainfrom
lewing merged 1 commit intodotnet:mainfrom
Conversation
The inotify refactor (dotnet#117148) changed stop/start timing for watches, which can delay event delivery under stress. The 500ms timeout is too tight for jitstress runs on slower hardware (arm32), causing false failures in SymbolicLink tests. Double the timeout from 500ms to 1000ms to better distinguish timing issues from functional bugs. This affects 94 tests that use the default ExpectEvent timeout. Ref: dotnet#125737 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-io |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR increases the default wait timeout used by FileSystemWatcher test utilities to reduce Linux (notably arm32 jitstress) timing-related flakiness after the inotify refactor.
Changes:
- Increase
WaitForExpectedEventTimeoutfrom 500ms to 1000ms in the FileSystemWatcher test base helper.
Comments suppressed due to low confidence (1)
src/libraries/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs:28
- Raising WaitForExpectedEventTimeout will also increase the default wait for negative assertions and fixed sleeps that use this constant (e.g., ExpectNoEvent has a default
timeout = WaitForExpectedEventTimeout, and some tests callThread.Sleep(WaitForExpectedEventTimeout)). That can add ~500ms per such call to successful test runs. Consider keepingWaitForExpectedEventTimeoutscoped to expected events only (e.g., change ExpectNoEvent’s default toWaitForUnexpectedEventTimeout, or introduce a separate constant for the longer expected-event wait) so the flakiness fix doesn’t unnecessarily slow the suite.
public const int WaitForExpectedEventTimeout = 1000; // ms to wait for an event to happen
public const int LongWaitTimeout = 50000; // ms to wait for an event that takes a longer time than the average operation
public const int SubsequentExpectedWait = 10; // ms to wait for checks that occur after the first.
public const int WaitForExpectedEventTimeout_NoRetry = 3000;// ms to wait for an event that isn't surrounded by a retry.
public const int WaitForUnexpectedEventTimeout = 150; // ms to wait for a non-expected event.
You can also share your feedback on Copilot code review. Take the survey.
This was referenced Mar 18, 2026
tmds
approved these changes
Mar 18, 2026
steveisok
approved these changes
Mar 18, 2026
adamsitnik
approved these changes
Mar 18, 2026
Member
adamsitnik
left a comment
There was a problem hiding this comment.
LGTM, big thanks for fixing it @lewing !
Member
Author
|
/ba-g failures are infrastructure and actively being resolved |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Increase
WaitForExpectedEventTimeoutfrom 500ms to 1000ms per @tmds suggestion in #125740 (comment).The inotify refactor (#117148) changed stop/start timing for watches, which can delay event delivery under stress conditions. The 500ms timeout is too tight for jitstress runs on slower hardware (arm32), causing false failures in SymbolicLink tests that are being incorrectly attributed to #103630.
This is a single constant change that affects 94 tests using the default
ExpectEventtimeout. It should help distinguish timing issues from functional bugs.Ref: #125737, #125740
/cc @tmds @adamsitnik @jozkee