Skip to content

test: wait for conditions instead of fixed sleeps, shared wait_until helper - #823

Merged
ajianaz merged 2 commits into
developfrom
test/812-wait-until-clean
Nov 15, 2026
Merged

ajianaz merged 2 commits into
developfrom
test/812-wait-until-clean

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds wait_until / wait_for (polling, 60 s bound) next to TestDir in the tole-core and tole-cli test support, and converts the sleep-then-assert tests and hand-written deadline loops to them.

Why

Fixed sleeps are the root of the flaky tests in #702, #712 and #738 and of delegated_approval_e2e::no_answer_is_a_denial (comment on #812): they pass on a free machine and fail on a loaded one.

Changes

  • Helpers wait_until / wait_for with tests (test_dir_helper).
  • About 35 files converted: tole-core children/agents.rs, jobs.rs, sandbox, mcp and e2e tests; tole-cli delegate_tests.rs (the WAIT_TICKS constant is gone), discuss/tool_tests.rs, serve, cancel, sibling-notice, writer-lock and TUI e2e tests.
  • CONTRIBUTING.md: a "Waiting in tests" rule. docs/epics.md: one line.

Testing

  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, full cargo test --workspace pass; the full run pinned to one CPU passed before the merge with develop.
  • Old versus new, 12 runs each on sibling_notice_e2e, serve_session_cancel, acp_session_cancel, writer_lock_e2e: 0 failures either way. Further stress: skill_approval_e2e 200 runs, session_effort_e2e 60, wire_size_missions 60: 0 failures.
  • Not checked: clippy --all-targets under --no-default-features --features shell-tools fails on an unused mut in tests/owner_only_e2e.rs:84 (not in this diff; CI's no-mcp job passes).

Part of #812

…helper (#812)

Adds wait_until/wait_for (60 s bound, polls) next to TestDir in the test
support modules and converts sleep-then-assert tests and ad-hoc deadline
loops to them. CONTRIBUTING gets the rule.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants