Skip to content

perf(test): replace fixed waits with observable completion #2389

Closed

Description

@Astro-Han

Part of #2382.

Problem

Several tests wait for fixed wall-clock intervals even though completion can be observed or controlled. Examples include Pi TUI polling, Runtime Host fake shutdown, desktop animation waits, and alignment audit settling.

Fixed waits increase wall time and make tests sensitive to machine load.

Outcome

Replace fixed waits with the closest deterministic mechanism:

  • Controlled clocks for timer behavior.
  • Explicit barriers for asynchronous lifecycle tests.
  • Readiness markers or state polling for UI and audit tests.

Preserve tests whose purpose is a real timeout or process deadline. Make changes per workspace in independently reviewable PRs and include before/after timing.

Activity

  1. added
    enhancement
    on Aug 7, 2026
  2. UncertaintyDeterminesYou4ndMe commented on Aug 7, 2026

    @UncertaintyDeterminesYou4ndMe
    Contributor

    I'd like to take this one. It's a direct continuation of #2394, which removed the same fixed-delay pattern from the computer-use cancellation tests — same methodology (replace elapsed-time guesses with observable synchronization: controlled clocks, barriers, readiness markers), applied to the remaining workspaces (Pi TUI polling, Runtime Host fake shutdown, desktop animation waits, alignment audit settling). Will split per workspace into independently reviewable PRs with before/after timing, as the issue specifies.

  3. UncertaintyDeterminesYou4ndMe commented on Aug 7, 2026

    @UncertaintyDeterminesYou4ndMe
    Contributor

    Retracting my claim for now — this is best done after #2394 lands (same test-infrastructure territory), and I'd rather not hold the issue while blocked on that. Will pick it back up if it's still unclaimed then.

  4. UncertaintyDeterminesYou4ndMe commented on Aug 7, 2026

    @UncertaintyDeterminesYou4ndMe
    Contributor

    Picking this back up (per discussion) — proceeding now with the same methodology as #2394, one PR per workspace as the issue specifies. Starting with an audit of the named spots: Pi TUI polling, Runtime Host fake shutdown, desktop animation waits, alignment audit settling.

  5. UncertaintyDeterminesYou4ndMe commented on Aug 7, 2026

    @UncertaintyDeterminesYou4ndMe
    Contributor

    All four named areas are covered, one PR per workspace as specified:

    Workspace PR Timing
    Pi TUI (packages/cli) #2448 15.5s → 12.1s focused suite; 55 unconditional sleeps replaced with observable waits, 81 close watchdogs moved to a CI-scaled budget, elapsed ticker now injectable
    Runtime Host #2450 the two 2.1s liveness-crossing waits (incl. the fake-shutdown authority) → ~0.37s each via an injectable probe cadence
    Desktop e2e #2452 4 animation sleeps → toPass() geometry polls, 1 layout sleep → scrollHeight-stable wait; wall parity (worker-overlapped) but load-tolerant
    Alignment audit #2453 flat 2.5s×11 settle → mutation-quiet window under the same budget; 42.5s → 22.7s

    Each PR names the contracts that stay covered and the real-timeout waits that were deliberately preserved (signal-exit probes, the 3s exit grace, retry cadences, selection-settle negative windows).

  6. Astro-Han commented on Aug 8, 2026

    @Astro-Han
    ContributorAuthor

    Completed. All four named areas have now moved from fixed waits to observable completion through independently reviewed changes:

    The remaining waits in those changes are deliberate timeout/deadline contracts rather than completion guesses. Closing this issue as delivered.

    简体中文

    已完成。Issue 列出的四个区域都已经通过独立 PR,将固定等待替换为可观察的完成条件:

    这些改动中保留的等待属于有意验证的 timeout/deadline 契约,不再是对完成时间的猜测。按已交付关闭。

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions