test: keep Baseline fault injection effective on Windows - #82
Open
dayebishouji wants to merge 1 commit into
Open
dayebishouji wants to merge 1 commit into
dayebishouji wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes and why
On Windows,
blockBaselineBackupReplacementdoes not reliably cause a Baseline backup failure:AtomicWritecan 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.Cleanupso 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 production code, CLI/MCP behavior, data format, or transaction identity changes.
Verification
go test ./internal/cli -count=1fails on unchangeda24fb8b(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.make fast.make verifycompleted all gates. Everymake fullconstituent passed, includinggo 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.make verifycommand is not green (exit 2).7105b4c.git diff --checkand 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
The ordinary package test stays in Observe. Only its Baseline fingerprint is refreshed; no cognition Entry changes.