Repository navigation
CI's PostgreSQL test cluster loads pg_stat_statements, so its statement-count pins run instead of skipping - #4485
Merged
Merged
Conversation
…nt-count pins run instead of skipping The gated-live CI cluster (build.yml's darling-pg job, and nightly.yml's mirror of it) preloaded only timescaledb, so three live pins that count statements through pg_stat_statements skipped unconditionally there: OverviewFleetHealthSingleFlightLiveTests, StoreSizeCacheLiveTests and WaitRateTileReadCountLiveTests. Both workflows' 5541 cluster now also preload pg_stat_statements, so those three pins run for real in CI. The three pins already isolated themselves correctly (own scratch database, a dbid-scoped reset, and a query-text filter), so no test code changed. Refs #4477.
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.
Refs #4477.
Why
Three live pins count statements through
pg_stat_statements:OverviewFleetHealthSingleFlightLiveTestsandStoreSizeCacheLiveTests(both from #4482), plusWaitRateTileReadCountLiveTests. Each skips itself when the extension is not inshared_preload_libraries, because that setting is fixed at server start and cannot be turned on from inside a test. The gated-live CI cluster (build.yml'sdarling-pgjob, andnightly.yml's copy of the same steps) preloaded onlytimescaledb, so all three passed vacuously — every CI run skipped, never ran, the statement-count assertion.What changes
Both workflows' throwaway PostgreSQL cluster (port 5541, the one
DARLING_TEST_PGpoints at) now preloadspg_stat_statementsalongsidetimescaledb:becomes
nightly.ymlstands up the same cluster shape for the sameDARLING_TEST_PG-gated classes, so it gets the identical one-line change. The other three CI clusters (5542/5543/5544, the log-format clusters) are untouched — none of the three pins runs against them.No test file changed. Each of the three pins already
CREATE EXTENSION IF NOT EXISTS pg_stat_statementsin its own scratch database and reads/reset that extension's counters scoped to that database's owndbid, so nothing in their isolation needed a fix.Isolation (confirmed, no changes needed)
OverviewFleetHealthSingleFlightLiveTestsScratchPostgresdatabase (#1776 own-store)pg_stat_statements_reset(0, $dbid, 0)before the pin's own readquery LIKE '%v_collection_log%' AND query LIKE '%last_zero_row_streak_break_time%', filtered bydbid = $1StoreSizeCacheLiveTestsScratchPostgresdatabasepg_stat_statements_reset(0, $dbid, 0)query LIKE '%pg_database_size%current_database%', filtered bydbid = $1WaitRateTileReadCountLiveTestsScratchPostgresdatabase (moved here for exactly this reason — see the class's own remarks)pg_stat_statements_reset(0, $dbid, 0)query LIKE '%peak_ms_per_sec%' AND query LIKE '%v_wait_stats%', filtered bydbid = $1pg_stat_statements' counters are cluster-wide, keyed bydbid, not private per database — every reset and read above filters on that scratch database's ownoid, so each of the three can run in parallel with any other live class on the same cluster without stepping on another class's in-flight count. None of the three needs[Collection("live-postgres")].Other classes checked
Preloading the extension could change what other live classes see, because some use this cluster as a PostgreSQL target. every class under
Darling/Darling.Teststhat mentionspg_stat_statements,shared_preload_librariesorpgssand also runs againstDARLING_TEST_PGwas inventoried and read. Result: none of them assumed the extension absent as a fixed fact.StoreStatementStatsLiveTests(3 tests gated onDARLING_TEST_PG)IsPreloadedAsyncitself first and branches its own expected outcome (ReadyvsNotPreloaded) on the live answer — adapts to either state by construction.ServerWatermarkCacheRunnerLiveTestspg_stat_statements; no assertion depends on preload state.DarlingMcpPgLoggingAuditToolsTests/...LivePostgresTestspg_settings/shared_preload_libraries.CollectorStateContractTests,DarlingAnomalyBaselineTests,DarlingCappedReadLivePostgresTests,DarlingMcpPgPlanToolsTests,DarlingPgTopQueriesLiveTests,DeltaFamilyIntervalCompletionLivePostgresTests,McpCollectionLogPerServerResponseBudgetLivePostgresTests,PgLogEventMetricsTests,PgStatementTextSourceTests,RawPurgeConvergeLiveTests,RuntimePreconditionMissTestspg_stat_statementsonly in doc comments, string-literal SQL under test, or unit-level (non-live) string assertions (PostgresFaultOutcomeTests,StoreStatementStatsTests) — none reads the live cluster's actual preload state.CiComposeWorkerSizingTests/CiClusterWorkerSizingTests(the census pins)CiClusterWorkerSizingTestsparses only the worker-count settings (timescaledb.max_background_workers,max_worker_processes), notshared_preload_libraries— no update needed.CiComposeWorkerSizingTestsasserts againstdocker-compose.yml's already-correctshared_preload_libraries=timescaledb,pg_stat_statements, a different file that stays untouched here.Test plan
dotnet buildforDarling.Tests.csprojandLite.Tests.csproj(macOS,EnableWindowsTargeting=true).timescaledbandpg_stat_statements: all three target pins run and pass (not skip). The classes listed above plus the census pins (CiComposeWorkerSizingTests,CiClusterWorkerSizingTests) andDocCommentHygieneTestsall pass on the same rig — 203 total, 0 failed, 1 expected unrelated skip.StoreSizeCacheLiveTestsruns in shard 1;WaitRateTileReadCountLiveTestsandOverviewFleetHealthSingleFlightLiveTestsin shard 2). On Not for merge: prove the statement-count pins fail in CI under one mutation each #4484 (closed, not merged), the same change plus one mutation per pin, CI failed exactly those three pins, one per mutation.CHANGELOG
None: a CI and test-only change; no shipped behavior changes.