Repository navigation
Commit 8fc8884
test(walk): the cancel test holds a listing open and counts the listings begun after the cancel, instead of racing the clock twice
tm-walk's cancel_returns_within_200ms_while_directories_are_being_listed
slept 50 ms and asserted that the one-second scripted walk was still
running, then timed the cancel against 200 ms. Both read this thread's
scheduling: a thread descheduled for a second saw the walk done, and on a
busy runner every wall bound eventually fails. The two tests of the same
shape were fixed in 24df6c4 and eb45e4e.
Now cancel_while_directories_are_being_listed_stops_every_worker_at_its_next_folder:
d0's listing is held open (Special::Held) until the cancel is asked, so
the walk cannot end first; two fixed workers; and after the cancel at
most one listing begins, the one the free worker was about to begin. The
clock is only the hang guard for take(), which joins every worker.
A cancel reaches the workers three ways: it closes the queue, each worker
checks at its next folder, and the driver closes the queue when it sees
it. The mutant with all three gone is red ("98 listings began after the
cancel"); the old test caught that mutant only through its 200 ms clock.
REACT_WITHIN is now used only by macOS's live module, so it is compiled
there only (clippy on the Linux and Windows targets called it unused).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent bbb93a8 commit 8fc8884
1 file changed
Lines changed: 43 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
1192 | 1194 | | |
1193 | 1195 | | |
1194 | 1196 | | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1200 | 1229 | | |
1201 | | - | |
1202 | | - | |
| 1230 | + | |
| 1231 | + | |
1203 | 1232 | | |
1204 | | - | |
1205 | | - | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
| 1233 | + | |
1210 | 1234 | | |
1211 | | - | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
1212 | 1240 | | |
1213 | 1241 | | |
1214 | 1242 | | |
| |||
0 commit comments