-
Notifications
You must be signed in to change notification settings - Fork 3.8k
test: use T.TempDir to create temporary test directory
#6681
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
Conversation
The directory created by `T.TempDir` is automatically removed when the test and all its subtests complete. Reference: https://pkg.go.dev/testing#T.TempDir Signed-off-by: Eng Zer Jun <[email protected]>
|
Hi @Juneezee. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Build succeeded.
|
estesp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
mikebrow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
not a fan of how t.TempDir() names the temp paths .. muxlock with a sequence counter..
maybe that could be extended some day to include more useful info to aid in debug
Signed-off-by: Eng Zer Jun <[email protected]>
|
Build succeeded.
|
fuweid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Even if the TempDir can reduce typing work, I think some specific names are more helpful when flaky case comes. For example, in TestLookupWithOverlay case, lower/upper/work names are readable when error.
A testing cleanup.
We can use the
T.TempDirfunction from thetestingpackage to create temporary directory. The directory created byT.TempDiris automatically removed when the test and all its subtests complete.Reference: https://pkg.go.dev/testing#T.TempDir