Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky FSW test #103873

Merged
merged 3 commits into from
Jun 24, 2024
Merged

Fix flaky FSW test #103873

merged 3 commits into from
Jun 24, 2024

Conversation

danmoseley
Copy link
Member

@danmoseley danmoseley commented Jun 23, 2024

Fix #103753

Test does not fail for me locally; making assumption that firing even more events will this will help avoid it failing elsewhere.

  1. Fix the calculation of the size of FILE_NOTIFY_INFORMATION, although this is likely not material.
  2. Fire 250x the number of events that will fill the buffer, instead of 100x. Takes the 3 tests from 3 seconds total to 28 seconds for me. Guessing this is hitting some kind of IO parallelism threshold.
  3. Speed up some by moving file system operations to threadpool. Takes tests to 20 seconds.
  4. Halve size of buffer, also reduce to 200x. Tests are 9 seconds.
  5. It's still slow so move to outerloop.

@danmoseley
Copy link
Member Author

danmoseley commented Jun 23, 2024

BTW error case of too small InternalBufferSize is not being tested on non Windows (which may have different error behavior/limits)

@danmoseley
Copy link
Member Author

Comment says "where filePath is the path to changed file relative to the path passed into ReadDirectoryChanges." .. but the math does not use the relative path. Small beans; will cause over estimate, increasing events.

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for providing the fix @danmoseley !

@adamsitnik adamsitnik requested a review from jozkee June 24, 2024 14:12
@danmoseley
Copy link
Member Author

Can we run outer loop on this PR? It's just speculation that this will fix the test

@jozkee
Copy link
Member

jozkee commented Jun 24, 2024

/azp list

This comment was marked as off-topic.

@jozkee
Copy link
Member

jozkee commented Jun 24, 2024

/azp run runtime-libraries-coreclr outerloop-windows

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jozkee
Copy link
Member

jozkee commented Jun 24, 2024

#103753 also mentions FileSystemWatcher_Directory_NotifyFilter_Attributes so it won't completely fix it.

@danmoseley
Copy link
Member Author

Right, not really evidence that's related. Eg., it didn't start on the same day, it only happened once.

@danmoseley
Copy link
Member Author

OK, Build Analysis is recognizing all failures, so this is good to merge if you're OK with that @jozkee

@jozkee jozkee merged commit d2eca3b into dotnet:main Jun 24, 2024
78 of 87 checks passed
@danmoseley danmoseley deleted the fix.fsw.test branch June 24, 2024 20:44
@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Test Failure] System.IO.Tests.InternalBufferSizeTests.FileSystemWatcher_InternalBufferSize
3 participants