From 24362567b91a099c5a1f5ce822f83f55516bf6de Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Mon, 11 Sep 2017 10:33:17 +0200 Subject: [PATCH] Fix test flakes --- wal_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wal_test.go b/wal_test.go index 180623dd0..a3177ee6a 100644 --- a/wal_test.go +++ b/wal_test.go @@ -382,7 +382,7 @@ func TestWALRestoreCorrupted(t *testing.T) { t.Run(c.name, func(t *testing.T) { // Generate testing data. It does not make semantical sense but // for the purpose of this test. - dir, err := ioutil.TempDir("", "test_corrupted_checksum") + dir, err := ioutil.TempDir("", "test_corrupted") require.NoError(t, err) defer os.RemoveAll(dir) @@ -399,6 +399,7 @@ func TestWALRestoreCorrupted(t *testing.T) { require.NoError(t, w.Close()) + w.files[0].Sync() // Corrupt the second entry in the first file. // 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