Skip to content

Fix flaky fanotify cross-watcher test - #65609

Open
Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:fix-fswatch-65586
Open

Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:fix-fswatch-65586

Conversation

@jakebailey

Copy link
Copy Markdown
Member
--- FAIL: TestFanotifyCrossWatcherSameFs (0.00s)
    --- FAIL: TestFanotifyCrossWatcherSameFs/Modify (0.32s)
        fanotify_linux_test.go:116: event mismatch
            want: [{update /tmp/TestFanotifyCrossWatcherSameFsModify1358202595/001/child}]
             got: [{update /tmp/TestFanotifyCrossWatcherSameFsModify1358202595/001/child} {update /tmp/TestFanotifyCrossWatcherSameFsModify1358202595/001/child}]

Sometimes the OS will emit multiple events, especially given file writes could be non-atomic. Just loosen the test expectations.

A file rewrite can produce multiple update notifications across debounce batches. The cross-watcher test only needs to verify delivery to the intended watch and isolation from the other watch.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the test change that tolerates duplicate fanotify update events.

No open issues 🎉

What changed in this PR

This PR reduces flakiness in the Linux fanotify cross-watcher test by allowing duplicate update events from a single file write.

Changes:

  • Replaces exact event-set matching with expectContains for watcher A.
  • Preserves the check that watcher B receives no phantom events.
File Description
tsc/​internal/​fswatch/​fanotify_linux_test.go Relaxes the modify-event assertion to tolerate duplicate OS notifications.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Needs merge

Development

Successfully merging this pull request may close these issues.

3 participants