Commit d979215
committed
CI: harden test_off_then_on_via_signal against SIGILL startup race
The fourth wall-clock/signal timing flake in the family addressed by #1069
(parity), #1071 (mac_sampler), etc. On a loaded macOS CI runner this test
intermittently failed with the child exiting at returncode 252 (= -SIGILL).
Root cause: the profiled child printed its PID and entered a busy loop
*before* Scalene installed its SIGILL start-profiling handler. The parent read
the PID, slept a fixed 0.1s, and sent SIGILL once. If Scalene hadn't installed
its handler within that window, SIGILL hit the default action and killed the
process.
Fix (test-only, no production change):
- The child installs its own no-op SIGILL handler *before* announcing its PID,
so an early start signal can never terminate it via the default action. Once
Scalene replaces that handler, the signal starts profiling as intended.
- The parent sends the start signal a few times over a short window (stopping
as soon as the child exits) instead of a single fixed-timing shot, so it no
longer depends on hitting the precise post-install instant.
- Lengthened the child's busy loop so the signal window is comfortably wide.
Verified locally: test passes 6/6 in isolation and the full
test_on_off_windows.py suite is 29/29.1 parent 0e51afd commit d979215
1 file changed
Lines changed: 35 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
492 | 493 | | |
493 | 494 | | |
494 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
495 | 506 | | |
496 | 507 | | |
497 | 508 | | |
| 509 | + | |
498 | 510 | | |
499 | 511 | | |
500 | 512 | | |
501 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
502 | 518 | | |
503 | 519 | | |
504 | | - | |
| 520 | + | |
505 | 521 | | |
506 | | - | |
| 522 | + | |
507 | 523 | | |
508 | 524 | | |
509 | 525 | | |
| |||
530 | 546 | | |
531 | 547 | | |
532 | 548 | | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
541 | 561 | | |
542 | 562 | | |
543 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
544 | 567 | | |
0 commit comments