Commit 296a84e
guard: make the stopped run hole certain instead of raced for
TestARunStoppedPartWayNamesEveryFileThatFinished needs a run where one
writer is still owed bytes while its neighbours have been renamed into
place. It bought that state with size - a first file sixteen times the
size of the rest - and that made it flaky, roughly one run in four
inside a full suite.
Size buys margin in work, and which writer finishes first is decided by
which one gets a processor. Measured with tools/probes/stoprace, fifty
runs per condition:
idle machine 0 failures in 50, 165 ms of unused margin
heavy disk writing beside it 0 failures in 25
CPU starved, 24 busy loops 14 failures in 25
So the disk was never involved, which is what the observation first
recorded. Under starvation the time to the first finished file goes from
11 ms to 5.8 s, and sixteen times the work stops meaning anything. A
full suite runs packages beside each other and builds binaries in sub
processes, so a starved machine is the normal condition there.
The file at index zero now carries a generator that writes nothing and
returns only once the run is cancelled, so it cannot finish whoever gets
a processor. Descriptor is a value and every planned file carries its
own copy, so this is installed after planning on one PlannedFile - the
registry is untouched, the other thirty one files write real bytes, and
every step of the engine below Plan is the one that ships.
The guard also asserts it has at least two writers, because with one the
held open file would wait for a cancellation nobody can send.
Measured after the change: 25 of 25 green under the same starvation, the
mutation that restores the prefix behaviour still reddens it, and the
guard writes 3.5 MiB where it used to write 94 MiB.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 9c8e468 commit 296a84e
2 files changed
Lines changed: 117 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
194 | 217 | | |
195 | 218 | | |
196 | 219 | | |
197 | 220 | | |
198 | 221 | | |
199 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
200 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
201 | 235 | | |
202 | 236 | | |
203 | 237 | | |
| |||
214 | 248 | | |
215 | 249 | | |
216 | 250 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
223 | 254 | | |
224 | | - | |
| 255 | + | |
225 | 256 | | |
226 | 257 | | |
227 | 258 | | |
228 | 259 | | |
229 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
230 | 268 | | |
231 | 269 | | |
232 | 270 | | |
| |||
273 | 311 | | |
274 | 312 | | |
275 | 313 | | |
276 | | - | |
277 | | - | |
278 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
279 | 317 | | |
280 | 318 | | |
281 | 319 | | |
| |||
0 commit comments