Skip to content

test(coderd/database/awsiamrds): fix unclosed pubsub #16202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Jan 20, 2025

I ran into this flake: https://github.com/coder/coder/actions/runs/12872577144/job/35888367523?pr=16030

So I looked at our uses of pubsub.New and this is the only culprit I could find.

=== FAIL: cli  (0.00s)
PASS
goleak: Errors on successful test run: found unexpected goroutines:
[Goroutine 179662 in state chan send, with github.com/coder/coder/v2/coderd/database/pubsub.(*PGPubsub).startListener.func1 on top of the stack:
github.com/coder/coder/v2/coderd/database/pubsub.(*PGPubsub).startListener.func1(0xc03b1f7480?, {0x0, 0x0})
	/home/runner/work/coder/coder/coderd/database/pubsub/pubsub.go:549 +0x3f0
github.com/lib/pq.(*Listener).emitEvent(...)
	/home/runner/go/pkg/mod/github.com/coder/pq@v1.10.5-0.20240813183442-0c420cb5a048/notify.go:825
github.com/lib/pq.(*Listener).listenerConnLoop(0xc03b1f7480)
	/home/runner/go/pkg/mod/github.com/coder/pq@v1.10.5-0.20240813183442-0c420cb5a048/notify.go:855 +0xd0
github.com/lib/pq.(*Listener).listenerMain(...)
	/home/runner/go/pkg/mod/github.com/coder/pq@v1.10.5-0.20240813183442-0c420cb5a048/notify.go:884
created by github.com/lib/pq.listener in goroutine 141375
	/home/runner/go/pkg/mod/github.com/coder/pq@v1.10.5-0.20240813183442-0c420cb5a048/notify.go:553 +0x1a7
]
FAIL	github.com/coder/coder/v2/cli	74.586s

@mafredri mafredri self-assigned this Jan 20, 2025
@mafredri mafredri requested review from johnstcn and f0ssel January 20, 2025 17:15
@mafredri mafredri enabled auto-merge (squash) January 20, 2025 17:19
@mafredri mafredri merged commit 4d9dd0a into main Jan 20, 2025
35 checks passed
@mafredri mafredri deleted the mafredri/fix-test-leak-unclosed-pubsub branch January 20, 2025 17:25
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants