mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-05 15:47:07 +00:00
Clean up temp files more thoroughly after testing. (#7815)
Our test cases spew a lot of files and directories around $TMPDIR. Make more thorough use of the testing package's TempDir methods to ensure these are cleaned up. In a few cases, this required plumbing test contexts through existing helper code. In a couple places an explicit path was required, to work around cases where we do global setup during a TestMain function. Those cases probably deserve more thorough cleansing (preferably with fire), but for now I have just worked around it to keep focused on the cleanup.
This commit is contained in:
@@ -126,7 +126,7 @@ func TestBasicGenesisDoc(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGenesisSaveAs(t *testing.T) {
|
||||
tmpfile, err := os.CreateTemp("", "genesis")
|
||||
tmpfile, err := os.CreateTemp(t.TempDir(), "genesis")
|
||||
require.NoError(t, err)
|
||||
defer os.Remove(tmpfile.Name())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user