Repository navigation
tests: wait on events instead of sleeps in the cli crate tests - #14821
Conversation
dx_test_scratch::wait adds bounded waits on real conditions: a path appearing (notify), a lock coming free, a pid exiting (pidfd, kqueue, WaitForSingleObject via dx_os_sys::exit) and a child exiting under a deadline. dx_testing, the process and nested probes, the nested harness and reaper, the lsp session and the maven pin use them in place of sleep-and-poll loops. Long-lived stand-in children block on stdin instead of sleeping. dx_testing::rlocation opens the runfiles manifest once instead of on every call, which made module_extension_srcs_test time out on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
Process, lease, prune, lock, http, shim, launcher, os_sys and worktree tests now wait on the real event with a deadline: a pid exiting, a lock coming free, a path appearing, a fifo or pipe that never gets a writer, or a peer closing its socket. Long-running sleep children become cat or read on a held pipe. The launcher copy goes through cp so no forked thread inherits a write fd, which removes the ETXTBSY retry loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
|
/evidence platforms=["linux_x86_64","macos_arm64","windows_x86_64"] task=test scope=//cli/process:all //cli/atomic_fs:all //cli/setup:all //cli/lock:all //cli/http:all //cli/shim:all //cli/launcher:all //cli/os_sys:all //cli/worktree:all //cli/test_scratch:all |
|
Review:
Checked and fine: lease and alive-lock waits (std |
Park in a function that never returns, bound the signals child with exit_within so a broken stop path fails instead of hanging, keep the SIGINT wait at 5 s, and keep failure-only messages on covered lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
|
Review findings addressed in 91576ca: (1) apply.rs wait_for panics on one covered line; (2) park moved into |
|
/evidence platforms=["linux_x86_64","macos_arm64","windows_x86_64"] task=test scope=//cli/process:all //cli/atomic_fs:all //cli/setup:all //cli/lock:all //cli/http:all //cli/shim:all //cli/launcher:all //cli/os_sys:all //cli/worktree:all //cli/test_scratch:all |
Keep the locked, locked_shared and unlocking lock_free helpers, and lower the sleep budget to what is left after the event-wait PRs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
…ts (#14832) #14821 added @crates//:notify to both BUILD files without declaring it in their Cargo.toml, so generate stops with unresolved import "notify" once the cfg(test) parse errors are gone. Declare it, repin dx_crates and take the buildifier wrapping generate now applies to fortran and haskell tests. Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Stacked on #14818 (uses its
dx_test_scratch::waithelpers).Replaces fixed sleeps and sleep-poll loops in cli test code with event waits that have a deadline: pid exit (pidfd/kqueue/process handle), lock coming free (blocking
File::lockin a thread), path appearing (notify), a fifo or held pipe for children that must stay alive, and peer socket close for stalled HTTP servers.eventuallyis removed fromdx_test_scratch.Flake fixed:
exec_launcher_testrun_scrubs_unset_variablesretried on ETXTBSY becausefs::copyheld a write fd that a concurrently forked test thread inherited; the copy now runs incp.Review paths:
cli/process/,cli/atomic_fs/,cli/worktree/.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus