Commit df2aade
authored
🤖 fix: use atomic writes for experiments cache (#1209)
The test `refreshExperiment updates cache and writes it to disk` was
flaky because `fs.writeFile` is not atomic — it truncates the file
before writing, creating a race window where readers can see an empty or
partial file.
Switch to `write-file-atomic` which writes to a temp file then renames,
making the operation atomic.
---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking:
`high`_1 parent b328d2d commit df2aade
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
301 | | - | |
| 303 | + | |
302 | 304 | | |
303 | 305 | | |
304 | 306 | | |
| |||
0 commit comments