mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Fix test flakes
This commit is contained in:
parent
6892fc6dcb
commit
24362567b9
|
@ -382,7 +382,7 @@ func TestWALRestoreCorrupted(t *testing.T) {
|
||||||
t.Run(c.name, func(t *testing.T) {
|
t.Run(c.name, func(t *testing.T) {
|
||||||
// Generate testing data. It does not make semantical sense but
|
// Generate testing data. It does not make semantical sense but
|
||||||
// for the purpose of this test.
|
// for the purpose of this test.
|
||||||
dir, err := ioutil.TempDir("", "test_corrupted_checksum")
|
dir, err := ioutil.TempDir("", "test_corrupted")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
defer os.RemoveAll(dir)
|
defer os.RemoveAll(dir)
|
||||||
|
|
||||||
|
@ -399,6 +399,7 @@ func TestWALRestoreCorrupted(t *testing.T) {
|
||||||
|
|
||||||
require.NoError(t, w.Close())
|
require.NoError(t, w.Close())
|
||||||
|
|
||||||
|
w.files[0].Sync()
|
||||||
// Corrupt the second entry in the first file.
|
// Corrupt the second entry in the first file.
|
||||||
// After re-opening we must be able to read the first entry
|
// After re-opening we must be able to read the first entry
|
||||||
// and the rest, including the second file, must be truncated for clean further
|
// and the rest, including the second file, must be truncated for clean further
|
||||||
|
|
Loading…
Reference in a new issue