Skip to content

Tests that assert on wall-clock time fail on a loaded machine #3064

Open

Description

@THEtheChad

Part of #3057. Builds on #3062 (time_scale).

Summary

Some tests assert that something finished within a fixed wall-clock time. On a loaded machine (parallel builds, other agents, a CI runner sharing its cores) they fail even though nothing is wrong.

Evidence (main bb08a69)

Assertions on speed:

Where Code
crates/engine/src/availability.rs:319 assert!(t0.elapsed() < Duration::from_millis(150), "the caller never waits for the probe");
crates/fetch/src/http.rs:635 assert!(t.elapsed() >= Duration::from_millis(100) && t.elapsed() < Duration::from_secs(1), …), with siblings at :624 and :653
crates/fetch/src/tests.rs:286 < 4 s, with a sibling at :304
crates/ui-egui/src/album_picker.rs:453 < 1 s
crates/preview/src/tests.rs:296 < 1 s
crates/catalog/src/tests.rs:726 < 2 s
crates/raw/tests/it/robust.rs:107 < 2.0 s

Against a wall-clock threshold:

  • crates/ui-egui/src/tests_activity.rs:88 assert_eq!(rows(&h), 0) races SHOW_AFTER_MS = 500 (panels/activity.rs).

The deadlines that only stop a test from waiting forever (for example 20–60 s render waits) are fine as they are, but they should scale too.

Proposed fix

  • "The caller never waits" checks: make them load-independent. Keep the probe's gate shut through the assertion, and assert that the call returned while it was still shut.
  • Bounds that only stop a wait: scale them with testkit::time_scale() (testkit has no deadline or watchdog helpers, and several test waits have no time limit #3062).
  • Checks that really measure speed: move them to cargo xtask bench, or mark them #[ignore] with a reason, as tests_view_cost.rs does.

Not in this issue

The intermittent MCP test, which is a race, not load (#3069).

Activity

  1. ticket-craft commented on Oct 26, 2026

    @ticket-craft

    Possibly related: #3062 and #3057.

  2. added 13 commits that reference this issue on Oct 27, 2026
  3. 158 remaining items

  4. added 14 commits that reference this issue on Nov 13, 2026
  5. THEtheChad commented on Nov 17, 2026

    @THEtheChad
    ContributorAuthor

    The PR for this (#3096, on #3083) is closed: main now gives slow tests longer budgets under coverage (#4230, #4323) instead of a time-scale variable. The wall-clock assertions listed above are still on main, so I am leaving this open for a fix that fits that approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions