8000 test: SIGKILL crash test checks committed data (#384) by adityamukho · Pull Request #484 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

test: SIGKILL crash test checks committed data (#384) - #484

Merged
adityamukho merged 2 commits into
v3from
test/384-crash-kill-data
Oct 8, 2026
Merged

adityamukho merged 2 commits into
v3from
test/384-crash-kill-data

Conversation

@adityamukho
@adityamukho adityamukho commented Oct 8, 2026 •
Copy link
Copy Markdown
Collaborator

Refs #384

What

tests/crash_kill_test.rs used to check only that the file reopened and one AEVT query ran. It missed #370 (EAVT) and could not reach #371 (one fact per transaction). Now:

  • The child runs a seeded, deterministic workload: multi-valued batches, batched retracts and re-assertions, including strings over the 64-byte inline limit. It appends each transaction number to a log after execute returns.
  • Five modes, one per round: checkpoint after every transaction, after every third, never (WAL replay), automatically every 2 writes (wal_checkpoint_threshold(2)), and every third with SyncMode::Normal.
  • The parent kills the child after a random 1–60 confirmed transactions plus 0–20 ms of jitter, then replays the workload into a model.
  • The reopened tx_count must be N or N + 1, where N + 1 is a transaction that reached disk but not the log. The data must equal the model at that count through a full scan, AEVT per attribute, AVET per attribute and value, EAVT per entity and :as-of samples, and verify() must report no problems.
  • The checks run again after a second reopen and after a checkpoint plus reopen.
  • The test prints its base seed, and MINIGRAF_CRASH_KILL_SEED replays it.

Spec: docs/superpowers/specs/2026-10-08-crash-kill-data-check-design.md. Plan: docs/superpowers/plans/2026-10-08-crash-kill-data-check.md.

Verification

  • 5 rounds (per-PR default): 0.85 s.
  • 200 rounds locally: pass in 17 s. 138 of the 600 checks saw the in-flight transaction (N + 1) and 462 did not, so both allowed outcomes are exercised.
  • Mutation check: comparing against the model one transaction behind fails on the first round.
  • The test count is unchanged, because one test replaces another.

The nightly crash-kill.yml (100 rounds per OS) runs the new test unchanged; only its comments changed.

A v2.x backport (main) follows in a separate PR. It leaves out same-transaction multi-valued batches (#371, known v2.x issue) and verify(), which v2 does not have.

Nightly

crash-kill.yml now alternates between branches, as bench.yml does: main at 03:17 UTC and v3 at 15:17 UTC. The branch comes from the cron string, because scheduled runs always use the default branch's copy of the file. Failure issues name the branch and the commit that was tested. Both PRs carry the same file, so the setup keeps working after v3 becomes main.

🤖 Generated with Claude Code

https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h

The child runs a seeded workload (multi-valued batches, batched retracts,
re-assertions) under five checkpoint modes and logs each transaction after
execute returns. After the kill, the reopened file must equal the model after
the last logged transaction or the one in flight, through full-scan, AEVT,
AVET, EAVT and :as-of queries, with verify clean; again after a second reopen
and after a checkpoint plus reopen.

Refs #384

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
@codecov
codecov Bot commented Oct 8, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Scheduled runs use this file from the default branch, so the branch under
test comes from the cron string, as in bench.yml: main at 03:17 UTC, v3 at
15:17 UTC. Failure issues name the branch and the commit that was tested.

Refs #384

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
@adityamukho
adityamukho merged commit f9ced1c into v3 Oct 8, 2026
24 checks passed
@adityamukho
adityamukho deleted the test/384-crash-kill-data branch October 8, 2026 08:24
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

0