Skip to content

test(cron): make transient-conflict grace regression deterministic - #575

Merged
hardbyte merged 2 commits into
mainfrom
fix/cron-reconciliation-grace-test
Nov 3, 2026
Merged

hardbyte merged 2 commits into
mainfrom
fix/cron-reconciliation-grace-test

Conversation

@hardbyte

@hardbyte hardbyte commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Fix a timing-dependent assertion in transient_conflict_resets_grace_between_leader_passes. The old test required database publication and reconciliation to finish within 150 ms. When that real grace period elapsed on a busy runner, correct reconciliation could apply and fail !p.applied.

Use a 60-second grace and age only cron_owners.agreed_since with database time, following the neighboring restart/evidence-gap test. Remove both 170 ms sleeps. Exercise an already-mature unanimous empty manifest that briefly conflicts and then returns to the same desired hash without an applying leader pass in between. Verify publication clears all three durable agreement fields, restarts grace, keeps the invoice active before expiry, and actually retires it after agreement evidence is aged. The original !applied and positive remaining-grace assertions remain.

Publication calls evaluate_locked(..., true, false) under the same protocol transaction lock used by reconciliation. Read-only plans do not persist a reset. Keeping the old mature agreement across the mixed window would fail the direct durable-state assertion and permit immediate retirement, failing !applied. Returning to the same hash prevents a hash change from masking that regression. This sensitivity assessment is from code review; no separate code-mutation run was performed. No runtime or schema change is needed.

Validation:

  • Full CI passed: all 33 jobs, attempt 1, at exact head 4200851fef34cead0d3f9d76e2f171d5ee9086e9: https://github.com/hardbyte/awa/actions/runs/41124659427
  • Postgres 17 and 18: the named transient-conflict regression passed; each cron reconciliation suite finished 28 passed, 0 failed, 1 ignored. The ignored released-0.6.7 probe is unchanged: pg17/rest, pg18/rest.
  • Hosted fmt, clippy, workspace build, the complete Rust test matrix, Python 3.13/3.14, and the remaining full-CI checks passed.
  • Passed locally: git diff --check; ./scripts/ci-test-shard.sh check (50 test files). Local Cargo checks could not execute because the cloud image has no Rust toolchain; their hosted equivalents passed.
  • Remote head and clean local checkout match. Remote test blob 5e66d1a78d4bf85bdea0d071c33327b62845592f matches the local file.
  • Original main failure at f644f321ad110c6436382b64bdc0d935dcdeba5a: https://github.com/hardbyte/awa/actions/runs/41005608495/job/123900802654 (27 passed, 1 failed, 1 ignored).

Scope: only the cron reconciliation regression test. PR #572 is untouched. This PR remains a draft; no merge or release was performed.

Replace the 150 ms wall-clock assumption with database agreement fixtures.
Exercise a transient conflict returning to the same manifest and assert
publication clears durable agreement before retirement can resume.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8e2a2ab0-e5b5-48e9-8b8a-d2a7d9f16559
Commits

Reviewing files that changed from the base of the PR and between f644f32 and 4200851.

Files selected for processing: 1
  • awa/tests/cron_reconciliation_test.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@hardbyte hardbyte added the full-ci Run the full CI matrix (Python build+test, E2E) on this PR label Oct 30, 2026 — with ChatGPT Codex Connector
@hardbyte
hardbyte marked this pull request as ready for review November 3, 2026 02:18
@hardbyte
hardbyte merged commit c9b0223 into main Nov 3, 2026
34 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T02:19:41.768255Z 4200851 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Labels

full-ci Run the full CI matrix (Python build+test, E2E) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant