Skip to content

Flaky on macOS CI: desktop::safety dropping_the_supervisor_lets_the_switch_trip_on_its_own #50

Closed

Description

@blockmandev

What failed

test (macos-latest) on PR #49 (run 39857560692, job 120099622739). The rerun passed, and the PR doesn't touch this code.

panicked at src/desktop/safety.rs:513:13
  left: Err(Unsupervised { silent_for: 136.15525ms })
 right: Ok(())

Why

src/desktop/safety.rs:507-522:

  • The test builds a Safety with a 120 ms deadline and a supervisor that beats every 20 ms.
  • It sleeps 60 ms, then asserts the switch is still live (line 513).
  • The supervisor thread went 136 ms without being scheduled. On a loaded runner, running ~2200 lib tests in parallel, that is enough to miss the deadline.

The code under test behaved correctly: it refused when it went unsupervised. What fails is the test's assumption that a thread gets CPU time within 120 ms.

Fix to make

Give the "still live" half of the test a deadline far longer than any scheduler stall (e.g. seconds). Keep the "trips once dropped" half by waiting for the refusal with a bounded poll instead of a fixed sleep(250ms). Check the sibling tests in the same module (e.g. the one around line 480, a 60 ms sleep then 120 ms) for the same pattern.

Activity

  1. added a commit that references this issue on Oct 22, 2026
    9fec014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions