Files
craft-libs/crates/control/tests
dotCooCoo 7b29a321a5 control: the launch tests run on a test clock and wait on the calls instead of on time
LiveConfig takes the clock and the sleep its launch wait uses (Instant::now
and std::thread::sleep unless a test changes them), and a hook that each
resolve calls once it has noted how many starts have finished, before it
waits for the lookup. All three are hidden from the docs.

The four launch tests in tests/agents.rs no longer depend on how fast the
machine runs:

- A launch that never finishes advances the test clock by each poll, and
  the test checks that the wait polled until the 40 ms timeout passed.
- Concurrent calls: the app accepts agents only after all four calls have
  queued and the start has begun, instead of 60 ms after the start.
- Calls behind a failed start: the start returns once all four calls have
  queued, instead of after a 5 s poll and a 250 ms sleep, and the 150 ms
  timeout passes on the test clock.
- A huge timeout or poll: the test records each sleep, checks that the
  poll is cut to 1 s, and checks that an app that never accepts agents
  gives up after 600 polls with "within 600 s", instead of checking that
  the call took less than 5 s.

The file's wait_for helper, which polled for up to 5 s, has no caller left
and is removed.
2026-11-27 17:44:57 -08:00
..