Commit 265744b
committed
fix(windows): add file flush delay to prevent ENOENT errors in tests
On Windows, file operations can be asynchronous at the OS level. After writeFile() completes, the file handle may not be fully released immediately, causing ENOENT errors when code tries to read the file right after writing.
Enhanced retryWrite() with aggressive delays for Windows CI runners:
- Increase initial delay to 50ms (from 20ms) for more reliable file flushing
- Increase max access retries to 5 (from 3) for slower CI environments
- Add exponential backoff for access retries: 30ms, 60ms, 90ms, 120ms, 150ms
- Add 10ms stabilization delay after successful access
- Total potential wait time: up to 50ms + (30+60+90+120+150)ms + 10ms = 510ms
This fixes intermittent test failures in Windows CI runners, including:
- "should handle load -> update -> save workflow"
- "should use default 2-space indent for new files"
- "should preserve line endings"
- "should support sort option"1 parent 1fb817e commit 265744b
1 file changed
+30
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
61 | 90 | | |
62 | 91 | | |
63 | 92 | | |
| |||
74 | 103 | | |
75 | 104 | | |
76 | 105 | | |
77 | | - | |
| 106 | + | |
78 | 107 | | |
79 | 108 | | |
80 | 109 | | |
| |||
0 commit comments