Repository navigation
The same-major swap and in-place upgrade tests expect the postgresql.conf shape the managed-conf migration writes - #4461
Merged
Conversation
…t the #4336 migrated shape RuntimeAdvance_SameMajorStoreWithRealData_SwapsWithoutPgUpgradeAndKeepsEverything_Gated and UpgradeInPlace_OldMajorStoreWithRealData_UpgradesAndKeepsEverything_Gated asserted one occurrence of ConfMarker/ConfMarkerV6/ConfMarkerV7 in postgresql.conf after the store's first start on the new runtime. #4336 moved those blocks into darling-managed.conf behind the include on that same start, so postgresql.conf now carries none of them — the assertions expected 1 and got 0. Both now assert postgresql.conf carries the managed include (ManagedConfFile.HasManagedInclude) and zero occurrences of each marker, matching what ManagedConfUpgradePathTests.cs already asserts for the same migrated shape.
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 was failing
The 2026-09-27 nightly run's gated PostgreSQL leg failed
DarlingStoreUpgradeTests.RuntimeAdvance_SameMajorStoreWithRealData_SwapsWithoutPgUpgradeAndKeepsEverything_Gated(both
stamped: Trueandstamped: False) atDarlingStoreUpgradeTests.cs:3118:The same shape of assertion, on the same read of
postgresql.conf, also exists inUpgradeInPlace_OldMajorStoreWithRealData_UpgradesAndKeepsEverything_Gatedat the old line 2903 (this run'sown failure there was a later, unrelated socket error after that line — the marker assertion itself had
already passed there, which is the tell that something else was different about the same-major path).
Classification: stale test (S), not a product bug
PR #4336 ("Move the managed store's settings into one included file, darling-managed.conf") changed the
store's own conf layout on purpose: from that PR on, a data directory that gets a service-owned start
migrates its
postgresql.conffrom the old v1-v15 appended-block shape into oneinclude 'darling-managed.conf'line, with the settings (and their markers) rendered fresh into that included fileinstead.
ManagedConfMigrationState.Classify's own doc comment states the rule: only aLegacyconf (av-marker still present, or the include missing) may run the legacy appenders; a migrated conf never gets
them back. Both gated tests here run the product's real bootstrap through a full start, which is exactly the
one start that performs this migration — so
postgresql.confcorrectly ends up with the include and zerooccurrences of
ConfMarker/ConfMarkerV6/ConfMarkerV7, not one.ManagedConfUpgradePathTests.cs:261-262already asserts this same correct post-migration shape (
ManagedConfFile.HasManagedInclude(conf)true) fora real major upgrade — these two
DarlingStoreUpgradeTests.cspins were just never updated to match when#4336 landed on top of them, and #4446 (which touched a neighboring preload-line assertion in the same
tests, closing the 2026-09-26 nightly's finding) didn't reach this line either.
The fix
Changed both assertions from
Assert.Equal(1, CountOccurrences(...))toAssert.Equal(0, CountOccurrences(...)), and addedAssert.True(ManagedConfFile.HasManagedInclude(conf), ...)right beforethem, matching the pattern
ManagedConfUpgradePathTests.csalready uses for the same migrated shape. Bothsites got a comment naming #4336 as the reason the count is 0. No product code changed.
I scanned the rest of
DarlingStoreUpgradeTests.cs(git grep -n "CountOccurrences(conf, DarlingManagedPostgres.ConfMarker") and found only these two sites — no furtherstale assertions of this shape remain in this file.
The in-place upgrade test had also checked
shared_preload_librariesin postgresql.conf, where it no longer lives.bf74a5e94replaces that check withManagedPreloadAssert.FileLevel_HasOneManagedPreloadLine_WithBothLibraries, the same file-level check the same-major swap test makes after #4446. So the preload line is still checked, now where #4336 puts it.Sibling gated tests checked
ManagedConfUpgradePathTests.cs(UpgradeInPlace_OperatorLineBelowInclude_CarriedAndApplied_NoManagedKeyDuplicated_Gatedand its neighbors) already assert the correct post-Move the managed store's settings into one included file, darling-managed.conf (#4215) #4336 shape (
HasManagedIncludetrue, no v-marker) —consistent with this fix, no changes needed there.
DarlingManagedPostgresTests.cshas severalCountOccurrences(conf, DarlingManagedPostgres.ConfMarkerV8)assertions expecting 1 (or the deliberately-broken 3), but those exercise
EnsureConfAppendeddirectly ona still-Legacy conf, never through a migration — a different scenario, not stale.
When it last passed / what changed it
#4336(6dbb22a50, "Move the managed store's settings into one included file, darling-managed.conf") ison
devand is an ancestor of3f3f7cb95, the exact sha the 2026-09-27 nightly tested (git merge-base --is-ancestor 6dbb22a50 3f3f7cb95confirms it) — so these two gated tests have been asserting the pre-#4336 shape againstpost-#4336 product code since that commit landed, and could only have been green before it. The last green nightly run was not looked up by number;
the code-level evidence (the commit that changed the behavior, and the matching-shape assertion already
correct in
ManagedConfUpgradePathTests.cs) is conclusive on its own for classifying this as stale (S) ratherthan a product bug, and gives the exact commit to cite. My branch is cut from
origin/devat3f3f7cb95,the same sha the nightly ran, so this fix applies cleanly with no missing prerequisite commit.
Gated tests that must pass
These pass only on a test-only
nightly.ymlrun (publish=false); PR CI doesn't run them. The in-place upgrade test also fails earlier, on a separate cause fixed in its own PR, so it needs both changes for a pass.Darling.Tests.DarlingStoreUpgradeTests.RuntimeAdvance_SameMajorStoreWithRealData_SwapsWithoutPgUpgradeAndKeepsEverything_Gated(stamped: True)Darling.Tests.DarlingStoreUpgradeTests.RuntimeAdvance_SameMajorStoreWithRealData_SwapsWithoutPgUpgradeAndKeepsEverything_Gated(stamped: False)Darling.Tests.DarlingStoreUpgradeTests.UpgradeInPlace_OldMajorStoreWithRealData_UpgradesAndKeepsEverything_GatedThese are Windows-only, gated behind
DARLING_TEST_PGRUNTIME_*; they cannot run on macOS. The build isclean (0 errors, 0 warnings) for
Darling.Tests.csprojwithEnableWindowsTargeting=true.CHANGELOG entry
None: a test-only change. It updates gated test assertions to the postgresql.conf shape the store already produces after its managed-conf migration, and no product behavior changes.