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 tempdir failure in TestInitDatabaseService #50717

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zmb3
Copy link
Collaborator

@zmb3 zmb3 commented Jan 2, 2025

Setting auth's DataDir to t.TempDir() and then setting the storage config path to a t.TempDir() ends up creating two totally separate temporary directories, and the behavior that Teleport generally expects is that the auth audit storage is a subdirectory of auth's data dir.

Since #48247 merged it is no longer necessary to set the audit storage at all, the default behavior will be to put it in a subdirectory of the data dir.

 ➜ untilfail go test -race -failfast -count=10 -run TestInitDatabaseService ./lib/service
ok      github.com/gravitational/teleport/lib/service   26.720s
ok      github.com/gravitational/teleport/lib/service   27.293s
--- FAIL: TestInitDatabaseService (0.00s)
    --- FAIL: TestInitDatabaseService/enabled_valid_databases (2.09s)
        testing.go:1232: TempDir RemoveAll cleanup: unlinkat /var/folders/nq/cvbdfp8936791spb0cg91yrc0000gn/T/TestInitDatabaseServiceenabled_valid_databases726236108/002: directory not empty
FAIL
FAIL    github.com/gravitational/teleport/lib/service   22.311s
FAIL

zmb3 added 2 commits January 2, 2025 15:52
This test was setting the auth's storage config to use a different
temp dir than the backend's storage dir, which could result in the
non-empty directory that fails during cleanup.

As of #48247 tests don't need to set this at all since the default
behavior now does the right thing.
@zmb3 zmb3 added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v15 backport/branch/v16 backport/branch/v17 labels Jan 2, 2025
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from greedy52 January 3, 2025 14:01
@zmb3
Copy link
Collaborator Author

zmb3 commented Jan 3, 2025

@rosstimothy exclude flake for me?

@rosstimothy
Copy link
Contributor

/excludeflake *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants