Skip to content

Flaky: PTTInputDeviceProbeTests uses CI throughput as a liveness assertion #10724

Closed

Description

@tianmind-studio

Summary

PTTInputDeviceProbeTests.testMainRunLoopKeepsPumpingWhileTheHALIsWedged is flaky in Desktop Swift CI. The production change from #10695 is not implicated by the failures: the test's fixed 300 ms window asserts more than 10 timer ticks and more than 10 snapshot reads, turning a liveness requirement into a runner-throughput requirement.

Evidence

Two independent failures after #10695 landed:

In both runs, every sibling PTTInputDeviceProbeTests case passed. Other current-main runs pass, confirming the result depends on macOS runner contention.

Root cause

The acceptance criterion is binary: while the injected HAL probe is blocked off-main, the main run loop and currentSnapshot path must continue making progress. Requiring an arbitrary 11+ iterations in 300 ms measures host scheduling throughput instead. Under suite isolation and a loaded arm64 runner, RunLoop.main.run(mode:before:) may service only a few iterations even though neither the main actor nor snapshot read is blocked.

Proposed fix

Keep the HAL semaphore wedged and assert deterministic liveness/progress, not a fixed iteration rate. The test should still fail if the routing read moves back onto the main actor or waits for the HAL, while accepting any positive main-loop and turn-start progress under contention.

No production code change is needed.

Activity

  1. moved this from Someday to In progress in omi TODO / bountieson Jul 27, 2026
  2. tianmind-studio commented on Jul 27, 2026

    @tianmind-studio
    ContributorAuthor

    A third independent reproduction just completed on the refreshed #10574 head: run 30283186121 reported ticker.count == 7 and reads == 7; every sibling PTTInputDeviceProbeTests case passed again. The deterministic replacement is now open as #10725.

  3. added a commit that references this issue on Jul 27, 2026
    e4a6264
  4. moved this from In progress to In review in omi TODO / bountieson Jul 27, 2026
  5. added a commit that references this issue on Jul 28, 2026
    993dd96
  6. added a commit that references this issue on Aug 17, 2026
    4cd6e3c
  7. added a commit that references this issue on Sep 29, 2026
    2ac1096
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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions