Repository navigation
Commit f1aea59
committed
fix(ci): make test-barrier writes atomic
Path.write_text is not atomic: open(..., "w") publishes a zero-byte file
that a reader polling for existence can observe before the content lands
at close. The parallel harness contract polls for "<suite>.ready" and then
parses its content as the leader pid, so it could win that gap and hit
ValueError: invalid literal for int() with base 10: ''. Windows CI hit
this on the test-windows CLANG64 2/2 shard, which then produced no shard
manifest and cascaded into shard-completeness and ci-ok.
Write the barrier files to a same-directory temp path and os.replace()
them onto the destination, which is atomic on POSIX and Windows. A reader
now sees either no file or complete content.
Signed-off-by: Kody <kaidi.shi.1121@gmail.com>1 parent d846808 commit f1aea59
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
| |||
255 | 261 | | |
256 | 262 | | |
257 | 263 | | |
258 | | - | |
| 264 | + | |
259 | 265 | | |
260 | 266 | | |
261 | 267 | | |
262 | 268 | | |
263 | | - | |
| 269 | + | |
264 | 270 | | |
265 | 271 | | |
266 | 272 | | |
| |||
279 | 285 | | |
280 | 286 | | |
281 | 287 | | |
282 | | - | |
| 288 | + | |
283 | 289 | | |
284 | 290 | | |
285 | 291 | | |
| |||
0 commit comments