Repository navigation
Conversation
Three of these are expected to fail on Windows as the code stands: a Lock that meets a pending delete stays closed after the delete finishes, a waiting acquire fails instead of waiting it out, and the error cannot be told apart from a missing directory. The fourth runs the pattern that failed in Dolt's CI, lock files removed with os.Remove while held, to find out whether a pending delete is what caused it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
Stacked on #8. Adds Windows-only tests in
lock_windows_pending_test.go; no code changes.Windows CI is expected to fail on this PR. The tests have only been compile-checked (
GOOS=windows go vet), not run, so the expectations below are predictions from reading the code.TestLockUsableAfterDeletePendingLockthat met a pending delete works again once the delete finishes.reopenleaves it closed, so the nextTryLockshould report "lock is closed".TestWaitOutlastsDeletePendingLockWithTimeout(10s)waits out a delete that finishes 50ms later instead of returningos.ErrNotExistat once.TestDeletePendingIsTemporaryFailedwrappingos.ErrNotExist, andIsTemporaryis false for both.TestRacingRemoveWhileHeldos.Removethem while held, racing a creator, with Dolt's 100ms retry on access denied.The first three encode design opinions: the lock should recover, waits should wait, and the error should be distinguishable.
The fourth is there to test the diagnosis behind #8. The first commit of #8 showed that
os.Removeof a held lock file onwindows-latestdoes not leave the name delete-pending (New(deleted) = <nil>), andos.Removeis what Dolt uses.main, passes here: Report Windows delete-pending lock files as missing #8 fixes the Dolt failure.STATUS_DELETE_PENDINGwas not the cause.TestNewLockedDir_RacingCleanneeds to be run against Report Windows delete-pending lock files as missing #8 directly.It is a race test, so one green run proves little.
🤖 Generated with Claude Code