Commit 97fe90a
committed
fix: stabilize flaky AI snapshot tests
Two root causes identified and fixed:
1. expectFileDeleted used file.exists() which checks the _stat cache.
After unlink, _handleDirectoryChange re-reads the parent dir and
can repopulate _stat on the deleted File object from a racing
readdir. Switch to FileSystem.existsAsync() which bypasses the
cached _stat and goes directly to the impl.
2. _createOrUpdateFile could fail with NotFound when file.exists()
returned stale true after a delete+recreate cycle. Add fallback:
if getDocumentForPath fails, create the file on disk and retry.1 parent 13b5e58 commit 97fe90a
1 file changed
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
142 | 140 | | |
143 | 141 | | |
144 | 142 | | |
| |||
0 commit comments