Commit b024af9
DiffViewer: fix flaky Start_IgnoredPath_DoesNotFire watcher test
Writing a file inside a directory updates the parent directory's LastWrite timestamp on Windows, which the FileSystemWatcher reports as a separate Changed event on the directory itself - no trailing slash, so the test's ignore predicate (StartsWith(\\ignored/\\)) didn't match it. Whether that event arrived inside the 800 ms wait window was timing-dependent, causing intermittent failures.
Production callers don't have this gap: RepositoryService.IsPathIgnored delegates to LibGit2Sharp.Ignore.IsPathIgnored, which (per git semantics for \\ignored/\\) returns true for both the directory and its descendants. The hand-rolled test predicate was an over-narrow stand-in.
Broaden the predicate to match both \\ignored\\ exactly and \\ignored/\*\\ descendants. Added a comment explaining why both clauses are required so a future cleanup pass doesn't collapse them back. Verified by running the watcher tests 20x in a row with zero failures.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent b21fad2 commit b024af9
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
92 | 103 | | |
93 | 104 | | |
94 | 105 | | |
| |||
0 commit comments