Skip to content

refactor(tests): share chaos VM harness helpers - #1992

Merged
Sinity merged 1 commit into
masterfrom
feature/refactor/production-path-harness-1981
Jun 20, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/refactor/production-path-harness-1981

Conversation

@Sinity

@Sinity Sinity commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

Compress the duplicated VM chaos test plumbing into a shared helper module while preserving the existing per-case runner names and scenario structure.

Problem

#1981 asks Sinex to reduce duplicated test implementation without weakening nextest/impact observability. The three VM chaos categories repeated the same watched-directory fixture writes, event-count queries, systemd activity checks, command-status handling, and bounded event polling loops. That made the chaos suite harder to maintain while not improving failure granularity.

Solution

Added tests/vm-suite/src/categories/chaos_support.rs with shared helpers for watched-file writes, core.events counts, command status, service activity, bounded service waits, and bounded event-count waits. The clock-skew, network-partition, and process-restart scenarios now use those helpers, but their named runner cases remain separate and visible.

This is a #1981 phase, not a full issue close. Remaining #1981 work still includes replay harness cleanup, summarizer harness cleanup, compile-fail runner compression, and gate cadence visibility.

Verification

  • /var/cache/sinex/sinity/00dbba240e89/target/debug/xtask check --allow-contended-host -p sinex-vm-test-suite --fmt --format human
    • fmt check passed
    • cargo check passed
  • /var/cache/sinex/sinity/00dbba240e89/target/debug/xtask check --changed-strict origin/master --allow-contended-host --format human
    • changed-strict: 1 package checked, all passed

Ref #1981

Problem

#1981 asks for duplicated test implementation to be compressed without losing named test observability. The VM chaos categories repeated watched-file setup, service-active checks, command status calls, event-count queries, and bounded polling loops across independent files.

What changed

Added a chaos_support module for the repeated VM chaos helper operations and routed the clock-skew, network-partition, and process-restart categories through it. The individual chaos cases and their runner-visible names stay intact; only setup and polling plumbing moved.

Verification

/var/cache/sinex/sinity/00dbba240e89/target/debug/xtask check --allow-contended-host -p sinex-vm-test-suite --fmt --format human
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 11 minutes and 17 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Free

Run ID: 0e5a73de-0102-42b1-85ad-cfb1bd2946fb

📥 Commits

Reviewing files that changed from the base of the PR and between 985a7dc and 4a927d8.

📒 Files selected for processing (5)
  • tests/vm-suite/src/categories/chaos_clock_skew.rs
  • tests/vm-suite/src/categories/chaos_network_partition.rs
  • tests/vm-suite/src/categories/chaos_process_restart.rs
  • tests/vm-suite/src/categories/chaos_support.rs
  • tests/vm-suite/src/categories/mod.rs

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit aae8b54 into master Jun 20, 2026
2 checks passed
@Sinity
Sinity deleted the feature/refactor/production-path-harness-1981 branch June 20, 2026 04:38
Sinity added a commit that referenced this pull request Jun 20, 2026
Summary

Finishes the two #1981 closure gaps found after the replay-harness PR: the last direct trybuild runner setup now uses a shared support helper, and the verification policy now names when sampled impact audits are required instead of only mentioning impact explain output.

Problem

The #1981 false-close pass found that prior work had compressed the primitives compile-fail runner and documented selected-test evidence, but sinex-macros still owned a one-off trybuild setup and the policy did not tell future agents when to run `xtask impact audit --sample-skips N`. That left the verification cleanup issue almost closed but not exhausted.

Solution

- Add `crate/sinex-macros/tests/support/trybuild.rs` and route the macros compile-fail test through it while keeping the individual fixtures and stderr outputs explicit.
- Extend `.github/ci-policy.md` with impact explain/audit cadence for disputed test-scope claims, impact-planner changes, verification-policy changes, and false-close audits.
- Extend `xtask/docs/verification.md` with an impact-plan coverage audit row and concrete command pattern.

Acceptance matrix

- Required-input-key suite compression: satisfied by #1983.
- Production-path source/common source-path laws: satisfied by #1988.
- Replay/chaos/summarizer harness compression: satisfied by #1992, #1994, #1998, and #2000.
- Compile-fail runner compression: satisfied by #1997 for `sinex-primitives` and by this PR for `sinex-macros`.
- Gate visibility/cadence: satisfied by #1988 for changed-strict guidance and by this PR for impact explain/audit cadence.

Verification

- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask test --debug --heavy --include-ignored -p sinex-macros -E 'test(compile_fail_tests)' --format human`  
  Passed: 1, Ignored: 0.
- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask check --changed-strict origin/master --allow-contended-host --format human`  
  Passed locally.
- Pre-push `xtask check --changed-strict origin/master --allow-contended-host`  
  Passed: changed-strict checked `sinex-macros`.

Closes #1981
Sinity added a commit that referenced this pull request Jul 13, 2026
Summary

Compress the duplicated VM chaos test plumbing into a shared helper module while preserving the existing per-case runner names and scenario structure.

Problem

#1981 asks Sinex to reduce duplicated test implementation without weakening nextest/impact observability. The three VM chaos categories repeated the same watched-directory fixture writes, event-count queries, systemd activity checks, command-status handling, and bounded event polling loops. That made the chaos suite harder to maintain while not improving failure granularity.

Solution

Added `tests/vm-suite/src/categories/chaos_support.rs` with shared helpers for watched-file writes, `core.events` counts, command status, service activity, bounded service waits, and bounded event-count waits. The clock-skew, network-partition, and process-restart scenarios now use those helpers, but their named runner cases remain separate and visible.

This is a #1981 phase, not a full issue close. Remaining #1981 work still includes replay harness cleanup, summarizer harness cleanup, compile-fail runner compression, and gate cadence visibility.

Verification

- `/var/cache/sinex/sinity/00dbba240e89/target/debug/xtask check --allow-contended-host -p sinex-vm-test-suite --fmt --format human`
  - `fmt check passed`
  - `cargo check passed`
- `/var/cache/sinex/sinity/00dbba240e89/target/debug/xtask check --changed-strict origin/master --allow-contended-host --format human`
  - `changed-strict: 1 package checked, all passed`

Ref #1981
Sinity added a commit that referenced this pull request Jul 13, 2026
Summary

Finishes the two #1981 closure gaps found after the replay-harness PR: the last direct trybuild runner setup now uses a shared support helper, and the verification policy now names when sampled impact audits are required instead of only mentioning impact explain output.

Problem

The #1981 false-close pass found that prior work had compressed the primitives compile-fail runner and documented selected-test evidence, but sinex-macros still owned a one-off trybuild setup and the policy did not tell future agents when to run `xtask impact audit --sample-skips N`. That left the verification cleanup issue almost closed but not exhausted.

Solution

- Add `crate/sinex-macros/tests/support/trybuild.rs` and route the macros compile-fail test through it while keeping the individual fixtures and stderr outputs explicit.
- Extend `.github/ci-policy.md` with impact explain/audit cadence for disputed test-scope claims, impact-planner changes, verification-policy changes, and false-close audits.
- Extend `xtask/docs/verification.md` with an impact-plan coverage audit row and concrete command pattern.

Acceptance matrix

- Required-input-key suite compression: satisfied by #1983.
- Production-path source/common source-path laws: satisfied by #1988.
- Replay/chaos/summarizer harness compression: satisfied by #1992, #1994, #1998, and #2000.
- Compile-fail runner compression: satisfied by #1997 for `sinex-primitives` and by this PR for `sinex-macros`.
- Gate visibility/cadence: satisfied by #1988 for changed-strict guidance and by this PR for impact explain/audit cadence.

Verification

- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask test --debug --heavy --include-ignored -p sinex-macros -E 'test(compile_fail_tests)' --format human`  
  Passed: 1, Ignored: 0.
- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask check --changed-strict origin/master --allow-contended-host --format human`  
  Passed locally.
- Pre-push `xtask check --changed-strict origin/master --allow-contended-host`  
  Passed: changed-strict checked `sinex-macros`.

Closes #1981
Sinity added a commit that referenced this pull request Jul 16, 2026
Summary

Compress the duplicated VM chaos test plumbing into a shared helper module while preserving the existing per-case runner names and scenario structure.

Problem

#1981 asks Sinex to reduce duplicated test implementation without weakening nextest/impact observability. The three VM chaos categories repeated the same watched-directory fixture writes, event-count queries, systemd activity checks, command-status handling, and bounded event polling loops. That made the chaos suite harder to maintain while not improving failure granularity.

Solution

Added `tests/vm-suite/src/categories/chaos_support.rs` with shared helpers for watched-file writes, `core.events` counts, command status, service activity, bounded service waits, and bounded event-count waits. The clock-skew, network-partition, and process-restart scenarios now use those helpers, but their named runner cases remain separate and visible.

This is a #1981 phase, not a full issue close. Remaining #1981 work still includes replay harness cleanup, summarizer harness cleanup, compile-fail runner compression, and gate cadence visibility.

Verification

- `/var/cache/sinex/sinity/00dbba240e89/target/debug/xtask check --allow-contended-host -p sinex-vm-test-suite --fmt --format human`
  - `fmt check passed`
  - `cargo check passed`
- `/var/cache/sinex/sinity/00dbba240e89/target/debug/xtask check --changed-strict origin/master --allow-contended-host --format human`
  - `changed-strict: 1 package checked, all passed`

Ref #1981
Sinity added a commit that referenced this pull request Jul 16, 2026
Summary

Finishes the two #1981 closure gaps found after the replay-harness PR: the last direct trybuild runner setup now uses a shared support helper, and the verification policy now names when sampled impact audits are required instead of only mentioning impact explain output.

Problem

The #1981 false-close pass found that prior work had compressed the primitives compile-fail runner and documented selected-test evidence, but sinex-macros still owned a one-off trybuild setup and the policy did not tell future agents when to run `xtask impact audit --sample-skips N`. That left the verification cleanup issue almost closed but not exhausted.

Solution

- Add `crate/sinex-macros/tests/support/trybuild.rs` and route the macros compile-fail test through it while keeping the individual fixtures and stderr outputs explicit.
- Extend `.github/ci-policy.md` with impact explain/audit cadence for disputed test-scope claims, impact-planner changes, verification-policy changes, and false-close audits.
- Extend `xtask/docs/verification.md` with an impact-plan coverage audit row and concrete command pattern.

Acceptance matrix

- Required-input-key suite compression: satisfied by #1983.
- Production-path source/common source-path laws: satisfied by #1988.
- Replay/chaos/summarizer harness compression: satisfied by #1992, #1994, #1998, and #2000.
- Compile-fail runner compression: satisfied by #1997 for `sinex-primitives` and by this PR for `sinex-macros`.
- Gate visibility/cadence: satisfied by #1988 for changed-strict guidance and by this PR for impact explain/audit cadence.

Verification

- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask test --debug --heavy --include-ignored -p sinex-macros -E 'test(compile_fail_tests)' --format human`  
  Passed: 1, Ignored: 0.
- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask check --changed-strict origin/master --allow-contended-host --format human`  
  Passed locally.
- Pre-push `xtask check --changed-strict origin/master --allow-contended-host`  
  Passed: changed-strict checked `sinex-macros`.

Closes #1981
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.

1 participant