Commit caa7f19
authored
fix(test): wait for durable state instead of racing the daemon supervisor (#11927)
Four daemon tests failed on main. Three raced a documented asynchronous
contract; one repeated the path drift fixed in #11919.
`POST /controller/jobs/{id}/cancel` is asynchronous by design.
`request_controller_cancellation` persists the intent and only terminalizes
inline when the job is *claimless*; a running job is transitioned by the
supervisor thread spawned in `daemon::mod`. `LocalControllerJobClient::cancel`
states it outright: it persists a request and returns "the daemon's current job
projection" while "the controller continues provider shutdown asynchronously".
Asserting the terminal state immediately after the request is therefore a race
that only passes on an idle machine, and the cancel response body is a snapshot
at request time rather than the outcome. Add a bounded `wait_for` helper and
poll the durable state:
- controller_jobs_are_durable_idempotent_and_fail_closed_after_restart
- generic_cancel_rejects_running_controller_work_without_touching_its_driver
- controller_job_errors_use_driver_safe_public_projection
The no-leak assertions in the third are unchanged and still assert on a body
fetched after the projection lands.
Also convert four fixed-iteration poll loops (0..50 or 0..100 at 5-10ms, i.e. a
250-500ms budget) to the same helper, and fix
route_serves_run_scoped_artifact_store_tokens, which hardcoded
<home>/.local/share/homeboy/artifacts while HOMEBOY_DATA_DIR points the reader
elsewhere -- the fourth instance of the drift #11919 documented.1 parent af32b4f commit caa7f19
2 files changed
Lines changed: 68 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
314 | 339 | | |
315 | 340 | | |
316 | 341 | | |
| |||
399 | 424 | | |
400 | 425 | | |
401 | 426 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
408 | 431 | | |
409 | 432 | | |
410 | 433 | | |
| |||
437 | 460 | | |
438 | 461 | | |
439 | 462 | | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
451 | 473 | | |
452 | 474 | | |
453 | 475 | | |
| |||
776 | 798 | | |
777 | 799 | | |
778 | 800 | | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
783 | 807 | | |
784 | | - | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
785 | 811 | | |
786 | 812 | | |
787 | 813 | | |
| |||
1232 | 1258 | | |
1233 | 1259 | | |
1234 | 1260 | | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
1241 | 1264 | | |
1242 | 1265 | | |
1243 | 1266 | | |
| |||
1341 | 1364 | | |
1342 | 1365 | | |
1343 | 1366 | | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
1344 | 1375 | | |
1345 | 1376 | | |
1346 | 1377 | | |
| |||
2732 | 2763 | | |
2733 | 2764 | | |
2734 | 2765 | | |
2735 | | - | |
2736 | | - | |
2737 | | - | |
2738 | | - | |
2739 | | - | |
2740 | | - | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
2741 | 2770 | | |
2742 | 2771 | | |
2743 | 2772 | | |
| |||
0 commit comments