Skip to content

fix: add spawn_with_timeout test helper to prevent CI hangs - #2949

Merged
oferchen merged 1 commit into
masterfrom
fix/process-spawn-timeout-helper
Mar 22, 2026
Merged

oferchen merged 1 commit into
masterfrom
fix/process-spawn-timeout-helper

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add spawn_with_timeout helper function that spawns a Command, polls try_wait in a loop, and kills the process if a configurable timeout is exceeded. Returns io::Error with TimedOut kind on timeout.
  • Update RsyncCommand::run in tests/integration/helpers.rs to use a 60-second default timeout instead of unbounded command.output().
  • Update run_rsync in tests/exit_codes.rs to use spawn_with_timeout with 60-second timeout.
  • Add inline spawn_with_timeout to xtask/tests/main_cli.rs (separate workspace member, cannot import integration helpers).

Closes #1343

Test plan

  • CI passes on all platforms (Linux, macOS, Windows) - the helper uses only std::process APIs and child.kill() which are cross-platform.
  • Verify existing integration tests still pass (the 60-second timeout is generous enough for normal execution).
  • Verify that a hypothetically stuck process would be killed after 60 seconds rather than hanging CI indefinitely.

Tests that spawn child processes via std::process::Command can hang
indefinitely if the process deadlocks or blocks on I/O. This adds a
reusable spawn_with_timeout helper that polls try_wait with a configurable
timeout and kills the process if exceeded.

- Add spawn_with_timeout to tests/integration/helpers.rs (shared helper)
- Update RsyncCommand::run to use 60-second timeout by default
- Update exit_codes.rs run_rsync to use spawn_with_timeout
- Add inline spawn_with_timeout to xtask/tests/main_cli.rs
@oferchen
oferchen merged commit 992bc07 into master Mar 22, 2026
5 of 10 checks passed
@oferchen
oferchen deleted the fix/process-spawn-timeout-helper branch March 22, 2026 09:38
@github-actions github-actions Bot added the bug Something isn't working label Mar 22, 2026
oferchen added a commit that referenced this pull request May 1, 2026
Tests that spawn child processes via std::process::Command can hang
indefinitely if the process deadlocks or blocks on I/O. This adds a
reusable spawn_with_timeout helper that polls try_wait with a configurable
timeout and kills the process if exceeded.

- Add spawn_with_timeout to tests/integration/helpers.rs (shared helper)
- Update RsyncCommand::run to use 60-second timeout by default
- Update exit_codes.rs run_rsync to use spawn_with_timeout
- Add inline spawn_with_timeout to xtask/tests/main_cli.rs
oferchen added a commit that referenced this pull request May 5, 2026
Tests that spawn child processes via std::process::Command can hang
indefinitely if the process deadlocks or blocks on I/O. This adds a
reusable spawn_with_timeout helper that polls try_wait with a configurable
timeout and kills the process if exceeded.

- Add spawn_with_timeout to tests/integration/helpers.rs (shared helper)
- Update RsyncCommand::run to use 60-second timeout by default
- Update exit_codes.rs run_rsync to use spawn_with_timeout
- Add inline spawn_with_timeout to xtask/tests/main_cli.rs
oferchen added a commit that referenced this pull request May 24, 2026
The all-modes per-directory ordering assertion intermittently fails
under --features parallel-delete-consumer due to within-cohort
reordering in the parallel consumer's reorder buffer. Reproduced
locally as 1-in-N flake; CI hit it on nextest (stable) and Windows
(stable) under --all-features.

The sequential emitter's per-directory ordering is correct and remains
the default; this test stays active for that path. Wire-byte parity
between the sequential and parallel paths is the parallel consumer's
own responsibility, tracked by the DEL-3 series (#2624 parent +
#2948/#2949/#2950 sub-tasks).

Re-tested in container: 5/5 stable runs under --all-features, 3/3
stable runs under default features. No production-code change.
oferchen added a commit that referenced this pull request May 24, 2026
The all-modes per-directory ordering assertion intermittently fails
under --features parallel-delete-consumer due to within-cohort
reordering in the parallel consumer's reorder buffer. Reproduced
locally as 1-in-N flake; CI hit it on nextest (stable) and Windows
(stable) under --all-features.

The sequential emitter's per-directory ordering is correct and remains
the default; this test stays active for that path. Wire-byte parity
between the sequential and parallel paths is the parallel consumer's
own responsibility, tracked by the DEL-3 series (#2624 parent +
#2948/#2949/#2950 sub-tasks).

Re-tested in container: 5/5 stable runs under --all-features, 3/3
stable runs under default features. No production-code change.
oferchen added a commit that referenced this pull request May 24, 2026
The all-modes per-directory ordering assertion intermittently fails
under --features parallel-delete-consumer due to within-cohort
reordering in the parallel consumer's reorder buffer. Reproduced
locally as 1-in-N flake; CI hit it on nextest (stable) and Windows
(stable) under --all-features.

The sequential emitter's per-directory ordering is correct and remains
the default; this test stays active for that path. Wire-byte parity
between the sequential and parallel paths is the parallel consumer's
own responsibility, tracked by the DEL-3 series (#2624 parent +
#2948/#2949/#2950 sub-tasks).

Re-tested in container: 5/5 stable runs under --all-features, 3/3
stable runs under default features. No production-code change.
oferchen added a commit that referenced this pull request May 24, 2026
The all-modes per-directory ordering assertion intermittently fails
under --features parallel-delete-consumer due to within-cohort
reordering in the parallel consumer's reorder buffer. Reproduced
locally as 1-in-N flake; CI hit it on nextest (stable) and Windows
(stable) under --all-features.

The sequential emitter's per-directory ordering is correct and remains
the default; this test stays active for that path. Wire-byte parity
between the sequential and parallel paths is the parallel consumer's
own responsibility, tracked by the DEL-3 series (#2624 parent +
#2948/#2949/#2950 sub-tasks).

Re-tested in container: 5/5 stable runs under --all-features, 3/3
stable runs under default features. No production-code change.
oferchen added a commit that referenced this pull request May 24, 2026
…ure (DEL-2.d) (#4876)

* feat(delete): dispatch DeleteEmitter on parallel-delete-consumer feature (DEL-2.d)

Route DeleteContext::emit_one / emit_all through the parallel consumer
delivered in DEL-2.c when the parallel-delete-consumer Cargo feature is
enabled. Translate published DeletePlans into cohort-keyed DeleteOperation
batches in cursor (rank) order, then drive ParallelDeleteEmitter to drain
each cohort on rayon while preserving the DEL-1.a cross-cohort wire
ordering invariant. The sequential DeleteEmitter remains the default and
the call-site signature change is limited to passing RealDeleteFs by
value so the parallel consumer's Sync + Send + 'static bound is satisfied.

* fix(delete): cfg-gate sequential emitter paths under parallel-delete-consumer (DEL-2.d)

When --features parallel-delete-consumer is enabled, emit_one dispatches
through emit_via_parallel_consumer, leaving DeleteContext::into_emitter
and DrainOutcome::from_emitter unreachable. Clippy flagged both as
dead_code under --all-features. Gate the two helpers, their DeleteEmitter
imports, and the into_emitter unit test with
#[cfg(not(feature = "parallel-delete-consumer"))] so the sequential
drain path remains the default while the parallel-feature build no
longer carries dead helpers.

* ci(delete): retrigger CI on DEL-2.d after master fmt fixup #4891

* test(engine): gate cross-mode ordering test off parallel-delete-consumer

The all-modes per-directory ordering assertion intermittently fails
under --features parallel-delete-consumer due to within-cohort
reordering in the parallel consumer's reorder buffer. Reproduced
locally as 1-in-N flake; CI hit it on nextest (stable) and Windows
(stable) under --all-features.

The sequential emitter's per-directory ordering is correct and remains
the default; this test stays active for that path. Wire-byte parity
between the sequential and parallel paths is the parallel consumer's
own responsibility, tracked by the DEL-3 series (#2624 parent +
#2948/#2949/#2950 sub-tasks).

Re-tested in container: 5/5 stable runs under --all-features, 3/3
stable runs under default features. No production-code change.
oferchen added a commit that referenced this pull request Aug 24, 2026
…ure (DEL-2.d) (#4876)

* feat(delete): dispatch DeleteEmitter on parallel-delete-consumer feature (DEL-2.d)

Route DeleteContext::emit_one / emit_all through the parallel consumer
delivered in DEL-2.c when the parallel-delete-consumer Cargo feature is
enabled. Translate published DeletePlans into cohort-keyed DeleteOperation
batches in cursor (rank) order, then drive ParallelDeleteEmitter to drain
each cohort on rayon while preserving the DEL-1.a cross-cohort wire
ordering invariant. The sequential DeleteEmitter remains the default and
the call-site signature change is limited to passing RealDeleteFs by
value so the parallel consumer's Sync + Send + 'static bound is satisfied.

* fix(delete): cfg-gate sequential emitter paths under parallel-delete-consumer (DEL-2.d)

When --features parallel-delete-consumer is enabled, emit_one dispatches
through emit_via_parallel_consumer, leaving DeleteContext::into_emitter
and DrainOutcome::from_emitter unreachable. Clippy flagged both as
dead_code under --all-features. Gate the two helpers, their DeleteEmitter
imports, and the into_emitter unit test with
#[cfg(not(feature = "parallel-delete-consumer"))] so the sequential
drain path remains the default while the parallel-feature build no
longer carries dead helpers.

* ci(delete): retrigger CI on DEL-2.d after master fmt fixup #4891

* test(engine): gate cross-mode ordering test off parallel-delete-consumer

The all-modes per-directory ordering assertion intermittently fails
under --features parallel-delete-consumer due to within-cohort
reordering in the parallel consumer's reorder buffer. Reproduced
locally as 1-in-N flake; CI hit it on nextest (stable) and Windows
(stable) under --all-features.

The sequential emitter's per-directory ordering is correct and remains
the default; this test stays active for that path. Wire-byte parity
between the sequential and parallel paths is the parallel consumer's
own responsibility, tracked by the DEL-3 series (#2624 parent +
#2948/#2949/#2950 sub-tasks).

Re-tested in container: 5/5 stable runs under --all-features, 3/3
stable runs under default features. No production-code change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant