Browse Source

consensus: cleanup tempfile explictly (#8184)

pull/8185/head
Sam Kleinman 2 years ago
committed by GitHub
parent
commit
b29cc95920
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      internal/consensus/replay_test.go

+ 1
- 1
internal/consensus/replay_test.go View File

@ -652,12 +652,12 @@ func tempWALWithData(t *testing.T, data []byte) string {
walFile, err := os.CreateTemp(t.TempDir(), "wal")
require.NoError(t, err, "failed to create temp WAL file")
t.Cleanup(func() { _ = os.RemoveAll(walFile.Name()) })
_, err = walFile.Write(data)
require.NoError(t, err, "failed to write to temp WAL file")
require.NoError(t, walFile.Close(), "failed to close temp WAL file")
return walFile.Name()
}


Loading…
Cancel
Save