Repository navigation
Tests: a Windows file lock during managed-PostgreSQL test cleanup no longer fails the test - #4581
Merged
Merged
Conversation
…longer fails the test
erikdarlingdata
marked this pull request as ready for review
September 28, 2026 14:13
This was referenced Sep 28, 2026
erikdarlingdata
added a commit
that referenced
this pull request
Sep 30, 2026
… longer fails the store-move test (#4864) A managed PostgreSQL store test failed once in CI with an access-denied IOException from Directory.Move. The move runs right after the test stops the managed PostgreSQL. On Windows, a file the stopped process still maps can hold its folder for a moment, and until then the rename is refused. - The tests get a retrying move, MoveDirectoryOnceReleased. It tries the move again every 100 ms for up to 10 seconds while Windows refuses it. After that, the last exception escapes. - The store-move test uses it for its one move after the stop. Its assertions are unchanged. - Three Windows-only tests hold a file open without sharing in place of the process. A plain move is refused, and the retrying move completes once the file is released. A lock that never lifts fails only after the patience runs out. - The other moves in the Darling tests do not follow the stop of a real PostgreSQL, and they are unchanged. - Test-only change. Follow-up to #4581.
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.
Why
DarlingManagedPostgresTests.Postgres17Store_WithTheOldValueInItsManagedConf_StartsWithTheCap_Gatedfailed twice on Windows CI after every assertion had passed. Itsfinallydeletes the test's temp directory, and a file the just-stopped PostgreSQL process still maps (icudt67.dll) makes the delete throwUnauthorizedAccessException:The cleanup was already meant to be best-effort ("a temp directory the OS still holds is not this test's failure"), but it caught only
IOException, andUnauthorizedAccessExceptionis not one.What changes
Test code only. Every best-effort temp-directory delete that runs after a PostgreSQL stop, and that already caught
IOException, now catchesIOException or UnauthorizedAccessException(8 sites):DarlingManagedPostgresTests.cs: the flaky test's cleanup and two siblings with the same shape.DarlingCollectorToggleVerbLivePostgresTests.cs,ManagedConfMigrationRunnerTests.cs,ManagedConfMigrationStateTests.cs,ManagedConfMigrationStepsTests.csandManagedConfUpgradePathTests.cs: the same cleanup pattern.No assertion changes.
Test plan
Darling.Testsbuilds with 0 warnings.DARLING_TEST_PGRUNTIME_OLD) is built only for changes in the Darling store paths, and this change is test-only. The widened catch is exercised by the next PR or nightly run that builds the fixture.CHANGELOG
None: test-only change.