Skip to content

test: keep Baseline fault injection effective on Windows - #82

Open
dayebishouji wants to merge 1 commit into
aoci-spec:mainfrom
dayebishouji:test/windows-baseline-failure-fixture
Open

dayebishouji wants to merge 1 commit into
aoci-spec:mainfrom
dayebishouji:test/windows-baseline-failure-fixture

Conversation

@dayebishouji

@dayebishouji dayebishouji commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What changes and why

On Windows, blockBaselineBackupReplacement does not reliably cause a Baseline backup failure: AtomicWrite can rename the nonempty backup directory aside and successfully publish the file. This makes failure/recovery tests unexpectedly succeed or fail while removing the displaced blocker.

Keep the directory open until the fixture is unblocked, preventing the Windows rename-aside fallback. Register the idempotent unblock function with t.Cleanup so tests that discard the returned function also close the handle. Existing failure and recovery assertions are unchanged.

Refs #79, specifically the Windows test-fixture report. This is an independent test-only follow-up; the console-window fix remains in #80.

Affected public contracts

  • No public contract changes.

No production code, CLI/MCP behavior, data format, or transaction identity changes.

Verification

  • Native Windows, Go 1.26.8: go test ./internal/cli -count=1 fails on unchanged a24fb8b (15 top-level tests; 17 failure events including subtests), then passes with this patch (236.525s). Top-level totals: 451 pass / 15 fail / 1 skip before; 466 pass / 0 fail / 1 skip after.
  • Focused Apply, recovery, and update-entry cases were also reproduced before the change and pass afterward.
  • Linux make fast.
  • Linux make verify completed all gates. Every make full constituent passed, including go test ./... (CLI 105.708s), race tests (CLI 667.546s), staticcheck, licensing, govulncheck, and clean-room smoke. The integration-tag database tests ran without configured live engines and therefore do not provide real-engine acceptance.
  • MCP conformance: 46 passed, 0 failed.
  • MCP scenarios: 61 passed, 0 characterized, 0 failed.
  • Lifecycle: 53 passed, 2 characterized, 1 failed. The database suite could not start Docker because Docker is unavailable in this WSL distribution; all other lifecycle groups completed. Consequently, the overall make verify command is not green (exit 2).
  • Remote fast-ci: all 8 checks passed for 7105b4c.
  • git diff --check and independent code review.

Operating system impact

Windows tests retain an open directory handle to prevent its replacement. POSIX already refuses replacing a directory with a file; the same helper remains portable. The handle is closed before fixture cleanup.

Migration and recovery

No migration or runtime recovery behavior changes.

Cognition

  • Completed AOCI maintenance, Observe acknowledgement, Verify, Check, and terminal Guide; governance is aligned.

The ordinary package test stays in Observe. Only its Baseline fingerprint is refreshed; no cognition Entry changes.

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