Browse Source

consensus: cleanup tempfile explictly

pull/8184/head
tycho garen 3 years ago
parent
commit
df6efc353a
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