Skip to content

fix(configreload): make watcher shutdown deterministic - #860

Merged
frahlg merged 1 commit into
masterfrom
agent/fix-watcher-start-flake
Aug 7, 2026
Merged

frahlg merged 1 commit into
masterfrom
agent/fix-watcher-start-flake

Conversation

@frahlg

@frahlg frahlg commented Aug 7, 2026

Copy link
Copy Markdown
Member

What changed

  • add watcher-local start and completion signals
  • make Stop() wait until the watcher loop has exited
  • replace process-wide goroutine counting and startup sleeps with watcher-local synchronization

Why

TestWatcherStartIsIdempotent counted all config watcher goroutines in the process. A watcher from an earlier test could exit after the baseline count, which hid the new watcher and caused the CI-only failure. Stop() returned before its loop exited, so one test could leave that goroutine running during the next test.

Impact

Runtime reload behavior stays the same. Shutdown now waits for the config watcher loop to finish. Calling Stop() before Start() remains safe.

Checks

  • go test ./internal/configreload -run 'TestWatcher(StartIsIdempotent|StopIsIdempotent|StopBeforeStart)$' -count=50
  • go test -race ./internal/configreload -count=10
  • make verify
  • pre-push make verify-all

Fixes #834

@frahlg frahlg added the no-changeset PR intentionally exempt from the changeset requirement (dev tooling / non-shipping) label Aug 7, 2026 — with ChatGPT Codex Connector

frahlg commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

Merge check complete for cfa667cea0fc8aca5cc096f751a4e8d53d334982.

  • No reviews or review threads.
  • No CODEOWNERS rule covers the two changed files.
  • The focused stress and race tests passed locally.
  • All relevant GitHub checks passed. The cancelled changeset run was replaced by a successful run.

Marking this ready, then merging with squash if the ready event adds no new blocker.

@frahlg
frahlg marked this pull request as ready for review August 7, 2026 06:16
@frahlg
frahlg merged commit 899205b into master Aug 7, 2026
13 of 14 checks passed
@frahlg
frahlg deleted the agent/fix-watcher-start-flake branch August 8, 2026 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changeset PR intentionally exempt from the changeset requirement (dev tooling / non-shipping)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: TestWatcherStartIsIdempotent — 'watcher loop did not start' under CI load

1 participant