You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[audit]: client/keys: Test_runImportHexCmd could become flaky due to overzealous os.Removeall(t.TempDir()) instead of creating a fresh directory of its own
#17854
Closed
1 of 4 tasks
odeke-em opened this issue
Sep 25, 2023
· 2 comments
· Fixed by #17855 or #17863
…per test run
Fixes undefined behavior that could result in test flakes on various
environments by creating a unique directory per sub-test run of
Test_runImportHexCmd. (*testing).T.TempDir() must not be mucked
around with.
Fixes#17854
Is there an existing issue for this?
What happened?
Noticed in an audit that Test_runImportHexCmd added this code in v0.50.0-rc.0
but a few problems:
kbHome := t.TempDir()
should be fixed up tokbHome := filepath.Join(t.TempDir(), fmt.Sprintf("%x", tc.name)))
defer func() { _ = os.RemoveAll(kbHome) }()
deletest.TempDir()
but it should have gotten a fresh directoryWe need to fix the above, otherwise the behavior will be undefined and it is trivial to fix compared to the problems that'll be caused.
Cosmos SDK Version
v0.50.0-rc.0
How to reproduce?
No response
The text was updated successfully, but these errors were encountered: