Skip to content

ci: clipboard_helper nonzero-exit test depends on scheduler timing (fixed by #228) #234

Open

Description

@KooshaPari

Summary

tui::app::helpers::clipboard_helper::tests::helper_that_exits_nonzero_falls_through is scheduler-timing dependent. It asserts the contract but reaches that assertion through the production 150 ms poll window, so on a loaded shared desk-linux runner the helper (false, expected to exit immediately) was not reaped within 150 ms and the "still running, owns the selection" branch won.

Observed on master (dabaab5b8), run 41547128038:

---- tui::app::helpers::clipboard_helper::tests::helper_that_exits_nonzero_falls_through stdout ----
panicked at crates/jcode-tui/src/tui/app/helpers/clipboard_helper.rs:79:9:
assertion failed: !copy_via_clipboard_helper("false", &[], "hello")

2516 passed, 1 failed. The failing test's timestamp was ~154 ms after the previous test finished, which matches the fixed 150 ms budget.

Scope

This issue tracks CI test determinism only.

ordering_tests::first_helper_that_wins had the same race and is covered by the same change.

Fix (PR #228)

  • Extract copy_via_clipboard_helper_within(program, args, text, window); keep the public signature and the production window unchanged (HELPER_FAIL_FAST_WINDOW = 150 ms).
  • Tests pass their own window: TEST_SETTLE_WINDOW (30 s) for the "exits nonzero" / "exits 0" cases, and a 10 ms window so a live owner (sleep 30) is deterministically still running.
  • New regression test helper_that_exits_nonzero_late_still_falls_through.
  • ordering_tests::first_helper_that_wins uses the same settle window.

Explicit non-goal

This change does not alter runtime behaviour or fix the production false-success defect, where a helper that has not failed yet is reported as a successful copy. That product question remains tracked separately in #231, whose status is unchanged by PR #228.

Acceptance for closing this

  • The clipboard-helper tests pass on a loaded desk-linux runner without depending on scheduler timing.
  • A test pins the late-failure case using an explicit window rather than the production budget.
  • Production HELPER_FAIL_FAST_WINDOW remains 150 ms.

Activity

  1. added
    kilo-triaged
    on Nov 3, 2026
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

    kilo-triaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions