Skip to content

test: reduce slow test wall-clock waits (stacked on #245) #246

@nshkrdotcom

Description

@nshkrdotcom

This issue tracks follow-up test performance work that is ready but waiting on a prerequisite PR before it can be opened upstream cleanly.

What

Commit 64538f3 on branch jido-test-cleanup-phase-2 reduces wall-clock time in the slowest parts of the test suite through the following changes:

  • Switched scheduler job timer dispatch to erlang.start_timer with ref-checked message matching, enabling tests to drive ticks deterministically without waiting on real-second cron boundaries. A new SchedulerTestControl test support module exposes force_tick/1, force_retry/1, and force_cron_restart/2 helpers used across scheduler, integration, instance manager, and cron tick delivery tests.
  • Replaced Process.sleep-based slow action fixtures in AgentServer tests with a GatedAction pattern that blocks on an explicit message, giving tests precise control over when an in-flight action completes.
  • Replaced the Process.sleep(1_000) fixture in the pod mutation concurrency test with an explicit gate in SlowMountPlugin, eliminating the longest single sleep in the suite.
  • Fast-failed dead-pid await paths: resolve_server/1 now checks Process.alive? before calling, and the :noproc exit is caught and normalized to {:error, :not_found}.
  • Warmed discovery once per suite via setup_all in discovery and jido tests instead of paying the refresh cost per test.
  • Reduced idle-timeout in InstanceManager tests from 200ms to 150ms where the assertion only needs eventual lifecycle behavior.

All changes pass mix test and mix q.

Status

This branch is stacked on log-refactor-phase-1, which is the subject of #244 and #245.

Once #245 merges, this branch will be rebased onto main and a clean upstream PR opened.

No action needed on this issue until #245 lands.

@mikehostetler — flagging for awareness given the dependency ordering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    parkedWorth keeping open, not worth acting on now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions