Merge pull request #13204 from serathius/flakes

test: Prevent TestMaintenanceSnapshotWithVersionVersion & TestSaveSnapshotVersion from flaking
This commit is contained in:
Piotr Tabor 2021-07-12 15:33:44 +02:00 committed by GitHub
commit a2274f55af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -253,6 +253,11 @@ func TestMaintenanceSnapshotWithVersionVersion(t *testing.T) {
clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1, SnapshotCount: 1})
defer clus.Terminate(t)
// Put some keys to ensure that wal snapshot is triggered
for i := 0; i < 10; i++ {
clus.RandClient().Put(context.Background(), fmt.Sprintf("%d", i), "1")
}
// reading snapshot with canceled context should error out
resp, err := clus.RandClient().SnapshotWithVersion(context.Background())
if err != nil {

View File

@ -54,7 +54,11 @@ func TestSaveSnapshotFilePermissions(t *testing.T) {
// TestSaveSnapshotVersion ensures that the snapshot returns proper storage version.
func TestSaveSnapshotVersion(t *testing.T) {
kvs := []kv{{"foo1", "bar1"}, {"foo2", "bar2"}, {"foo3", "bar3"}}
// Put some keys to ensure that wal snapshot is triggered
kvs := []kv{}
for i := 0; i < 10; i++ {
kvs = append(kvs, kv{fmt.Sprintf("%d", i), "test"})
}
cfg := newEmbedConfig(t)
// Force raft snapshot to ensure that storage version is set
cfg.SnapshotCount = 1