Skip to content

The collection-health fixture stops its scratch database's TimescaleDB scheduler, so no policy run the test did not make can land (#3986) - #3987

Merged
erikdarlingdata merged 1 commit into
devfrom
fix/3986-collection-health-fixture-scheduler
Sep 23, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
fix/3986-collection-health-fixture-scheduler

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Closes #3986.

Why

collection_health_hourly's refresh policy has no initial_start, so TimescaleDB's scheduler launches its first run as soon as the product's ensure path commits it. CollectionHealthAggregateTests.OpenStoreAsync could park the job only after that. A launch that landed first either:

What changes

Test plan

  • Measured on a PostgreSQL 18.4 + TimescaleDB 2.28.1 rig (this machine's stale pg-runtime.zip; CI's darling-pg job then ran the fixture on the pinned 2.30.1 runtime and passed, and The collection-health fixture's comment names the TimescaleDB version it was measured on (#3986 follow-up) #3988 corrects the code comment), using two probe databases, each with a CAGG and a policy with no initial_start:
    • stop_background_workers() stopped only its own database's scheduler; the other database's stayed up.
    • With the stop, the policy never ran on its own, total_runs stayed null and 0 buckets were materialized, and CALL run_job then materialized 47.
    • The control database's policy ran on its own within 15 s: 1 run, 47 buckets. That is the launch this fixture was racing.
  • CollectionHealthAggregateTests + FreshStoreWatermarkTests live on that rig, run five times in a row: 15/15 each time.
  • Build: 0 warnings.
  • CI's darling-pg full run.

Test-only change, so no CHANGELOG entry.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GdmA4ND1wLSqA91ax1m4xv

…B scheduler, so no policy run the test did not make can land (#3986)

collection_health_hourly's policy has no initial_start, so the scheduler
launched its first run the moment the ensure path committed it, before the
fixture could park it. #3982 retried the resulting 55P03 collision, but a
launch landing while the test was still planting moved the watermark under
rows a pre-run assertion then missed (OutageHole: 342 of 360). The fixture
now calls _timescaledb_functions.stop_background_workers() before the ensure
path and asserts no scheduler remains for the scratch database. Measured on
TimescaleDB 2.30.1: it stops only that database's scheduler, the scheduler
stays down, a no-initial_start policy never runs on its own (a control
database's ran within 15 s), and CALL run_job still works. RunPolicyAsync's
retry is gone with the race it papered over.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GdmA4ND1wLSqA91ax1m4xv
@erikdarlingdata
erikdarlingdata enabled auto-merge (squash) September 23, 2026 04:01
@erikdarlingdata
erikdarlingdata merged commit 824b42c into dev Sep 23, 2026
15 of 16 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/3986-collection-health-fixture-scheduler branch September 23, 2026 04:08
erikdarlingdata added a commit that referenced this pull request Sep 23, 2026
… it was measured on: 2.28.1, holding on CI's 2.30.1 (#3988)

#3987 said the scheduler-stop behavior was measured on 2.30.1. The rig was
this machine's stale pg-runtime.zip, TimescaleDB 2.28.1; CI's darling-pg job
ran the fixture on the pinned 2.30.1 runtime and passed.


Claude-Session: https://claude.ai/code/session_01GdmA4ND1wLSqA91ax1m4xv

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant