Skip to content

fix(test): prevent goroutine leak in PausableTicker and CronTicker tests#21968

Open
Fletch153 wants to merge 2 commits intodevelopfrom
fix/CORE-2401-ticker-goroutine-leak
Open

fix(test): prevent goroutine leak in PausableTicker and CronTicker tests#21968
Fletch153 wants to merge 2 commits intodevelopfrom
fix/CORE-2401-ticker-goroutine-leak

Conversation

@Fletch153
Copy link
Copy Markdown
Collaborator

Summary

  • TestPausableTicker and TestCronTicker leak goroutines across -count=N iterations
  • Destroy() stops the ticker but doesn't close Ticks() channel — goroutines in for range block forever
  • Fix: add done channels so goroutines exit when the test completes
  • Also reduce CronTicker verification sleep from 1s to 200ms

Test plan

  • Passes with -count=50 -race locally (155s)
  • CI passes

Fixes: CORE-2401

PausableTicker.Destroy() stops the ticker but doesn't close the
channel. Goroutines running for-range on Ticks() block forever,
accumulating across -count=N iterations.

Add done channels so goroutines exit when the test completes. Also
reduce CronTicker verification sleep from 1s to 200ms.

Fixes: CORE-2401
@Fletch153 Fletch153 requested review from a team as code owners April 10, 2026 14:17
@github-actions
Copy link
Copy Markdown
Contributor

👋 Fletch153, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Apr 10, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@cl-sonarqube-production
Copy link
Copy Markdown

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