Repository navigation
Commit 0ec088b
committed
test(ctags): lock the failed fake ctags start with set -C, not mkdir
TestStartSemanticCtagsParsersClosesTheStartedParsers failed on the
ubuntu-26.04-arm runner of CI run 40719104932: "started workers []
(err=<nil>), want 3". The fake ctags script picked the one failed start
with `mkdir "$ZQ_CTAGS_DIR/failed"` as a lock. Ubuntu 26.04 ships the
uutils (Rust) coreutils. Before 0.11.0, uutils mkdir exits 0 when a
concurrent call has made the folder first
(uutils/coreutils#13970). So all four
concurrent starts took the failed branch, and no worker started.
The script now creates the lock file with the shell's noclobber option:
`(set -C; : >"$ZQ_CTAGS_DIR/failed")`. The shell opens the file with
O_EXCL, so exactly one start creates it, with any coreutils. The
production code (startSemanticCtagsParsers) did not change.
Checks: a PATH shim mkdir that exits 0 on an existing folder gave the
CI message 5 times in 5 before the change; after it, the test passes
50 times in 50 with the shim, 50 in 50 without it, and 20 in 20 with
-race and the shim. A /bin/dash stress run (16 starts at the same time,
200 rounds) gave exactly one winner in each round.1 parent a98f2ec commit 0ec088b
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1108 | 1113 | | |
1109 | 1114 | | |
1110 | 1115 | | |
1111 | 1116 | | |
1112 | | - | |
| 1117 | + | |
1113 | 1118 | | |
1114 | 1119 | | |
1115 | 1120 | | |
| |||
0 commit comments