Skip to content
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

fix scavenger test suite #5490

Merged

Conversation

3vilhamster
Copy link
Member

What changed?
Fixed ScavengerTestSuite not waiting for the stop of the running scavenger.

Why?
The tests were leaking goroutine and logging outside of tests that can lead to panic: Log in goroutine after '' has completed

How did you test it?
unit tests with count=100

Potential risks

Release notes

Documentation Changes

@3vilhamster 3vilhamster enabled auto-merge (squash) December 18, 2023 20:21
@3vilhamster 3vilhamster merged commit 59f540d into cadence-workflow:master Dec 18, 2023
15 of 16 checks passed
@3vilhamster 3vilhamster deleted the fix-scavenger-test-suite branch December 18, 2023 21:14
waiter := make(chan struct{})

go func() {
s.scvgr.stopWG.Wait()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this during review. s.scvgr.Stop() is never called in tests and instead the passed ctx is expected to cancel after hardcoded 10s. Seems like that suite could be improved to manage lifecycle better and be self contained per test case.

Copy link
Member Author

@3vilhamster 3vilhamster Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is Stopped by the Scavenger itself after the run goroutine is finished.
The only possibility to leak goroutine/log is if the test times out, though the test will fail in this case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of a fix #5510

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.

2 participants