mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #13204 from serathius/flakes
test: Prevent TestMaintenanceSnapshotWithVersionVersion & TestSaveSnapshotVersion from flaking
This commit is contained in:
commit
a2274f55af
@ -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 {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user