Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

spikecurtis
Copy link
Contributor

The new pubsub spawns a goroutine that runs until the subscription is canceled.

ReplicaSync closes its subscription when its context expires, but in testing, we never expired the context at the end of the test, and so we could leak goroutines associated with their subscriptions. This PR fixes the tests.

I also noticed that it was possible to leak a goroutine if we fail to listen for an event; also addressed by this PR.

@spikecurtis spikecurtis requested a review from mtojek May 25, 2023 10:29
@spikecurtis spikecurtis changed the title Fix: pubsub goroutines in tests fix: pubsub goroutines in tests May 25, 2023
@spikecurtis spikecurtis merged commit 05da1e9 into main May 25, 2023
@spikecurtis spikecurtis deleted the spike/pubsub-test-leaks branch May 25, 2023 10:46
@github-actions github-actions bot locked and limited conversation to collaborators May 25, 2023
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