Commit 89252df
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() to:
- Add 10ms delay after writes on Windows to ensure file is flushed
- Verify file accessibility with fsPromises.access()
- Add fallback 10ms delay if file isn't accessible yet
- Use node:timers/promises sleep instead of raw setTimeout
This fixes the intermittent test failure in "should handle load -> update -> save workflow" on Windows CI runners.1 parent 1fb817e commit 89252df
1 file changed
+18
-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 | + | |
61 | 78 | | |
62 | 79 | | |
63 | 80 | | |
| |||
74 | 91 | | |
75 | 92 | | |
76 | 93 | | |
77 | | - | |
| 94 | + | |
78 | 95 | | |
79 | 96 | | |
80 | 97 | | |
| |||
0 commit comments