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

chore: Add Close Calls to BoltDB Tests to fix Windows Test Errors #5289

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

X-Guardian
Copy link
Contributor

what

Add close calls to all the BoltDB instances that are created in the unit tests.

why

On Windows, running any of the unit test that use test BoltDB instances results with failures on test clean-up of:

TestApplyCommandRunner_IsLockedIf_ApplyLockChecker_returns_an_error_IsDisabled_returns_false2845924729\001\atlantis.db: The process cannot access the file because it is being used by another process

Adding the correct clean-up of these databases resolves this issue.

tests

Tested locally

@X-Guardian X-Guardian marked this pull request as ready for review February 1, 2025 16:39
@X-Guardian X-Guardian requested review from a team as code owners February 1, 2025 16:39
@X-Guardian X-Guardian requested review from chenrui333, lukemassa and nitrocode and removed request for a team February 1, 2025 16:39
@github-actions github-actions bot added the go Pull requests that update Go code label Feb 1, 2025
@@ -0,0 +1,197 @@
package events
Copy link
Contributor

Choose a reason for hiding this comment

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

This and other .copy files, are they intentionally added?

Copy link
Contributor Author

@X-Guardian X-Guardian Feb 1, 2025

Choose a reason for hiding this comment

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

My bad. Accidentally committed some of my test files. Removed now.

@@ -38,18 +38,18 @@ func (r *debugReporter) Flush() {
}

func (r *debugReporter) ReportCounter(name string, tags map[string]string, value int64) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to comment these log lines out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above.

Signed-off-by: X-Guardian <[email protected]>
@X-Guardian X-Guardian force-pushed the boltdb-test-close-fix branch from c2fa89f to 82607eb Compare February 1, 2025 19:08
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code lgtm This PR has been approved by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants