@@ -24,6 +24,7 @@ import (
2424
2525 "go.etcd.io/etcd/api/v3/version"
2626 "go.etcd.io/etcd/client/pkg/v3/fileutil"
27+ "go.etcd.io/etcd/server/v3/etcdserver"
2728 "go.etcd.io/etcd/tests/v3/framework/e2e"
2829 "go.etcd.io/etcd/tests/v3/robustness/client"
2930 "go.etcd.io/etcd/tests/v3/robustness/failpoint"
@@ -39,16 +40,16 @@ type TrafficProfile struct {
3940}
4041
4142var trafficProfiles = []TrafficProfile {
42- // {
43- // Name: "EtcdHighTraffic",
44- // Traffic: traffic.EtcdPut,
45- // Profile: traffic.HighTrafficProfile,
46- // },
47- // {
48- // Name: "EtcdTrafficDeleteLeases",
49- // Traffic: traffic.EtcdPutDeleteLease,
50- // Profile: traffic.LowTraffic,
51- // },
43+ {
44+ Name : "EtcdHighTraffic" ,
45+ Traffic : traffic .EtcdPut ,
46+ Profile : traffic .HighTrafficProfile ,
47+ },
48+ {
49+ Name : "EtcdTrafficDeleteLeases" ,
50+ Traffic : traffic .EtcdPutDeleteLease ,
51+ Profile : traffic .LowTraffic ,
52+ },
5253 {
5354 Name : "KubernetesHighTraffic" ,
5455 Traffic : traffic .Kubernetes ,
@@ -93,11 +94,11 @@ func Exploratory(_ *testing.T) []TestScenario {
9394 mixedVersionOption := options .WithClusterOptionGroups (random.PickRandom [options.ClusterOptions ](mixedVersionOptionChoices ))
9495
9596 baseOptions := []e2e.EPClusterOption {
96- options .WithSnapshotCount (50 ),
97+ options .WithSnapshotCount (50 , 100 , 1000 ),
9798 options .WithSubsetOptions (randomizableOptions ... ),
9899 e2e .WithGoFailEnabled (true ),
99100 // Set a low minimal compaction batch limit to allow for triggering multi batch compaction failpoints.
100- options .WithCompactionBatchLimit (10 ),
101+ options .WithCompactionBatchLimit (10 , 100 , 1000 ),
101102 e2e .WithWatchProcessNotifyInterval (100 * time .Millisecond ),
102103 }
103104
@@ -106,20 +107,20 @@ func Exploratory(_ *testing.T) []TestScenario {
106107 }
107108
108109 if e2e .CouldSetSnapshotCatchupEntries (e2e .BinPath .Etcd ) {
109- baseOptions = append (baseOptions , options .WithSnapshotCatchUpEntries (100 ))
110+ baseOptions = append (baseOptions , options .WithSnapshotCatchUpEntries (100 , etcdserver . DefaultSnapshotCatchUpEntries ))
110111 }
111112 scenarios := []TestScenario {}
112- // for _, tp := range trafficProfiles {
113- // name := filepath.Join(tp.Name, "ClusterOfSize1")
114- // clusterOfSize1Options := baseOptions
115- // clusterOfSize1Options = append(clusterOfSize1Options, e2e.WithClusterSize(1))
116- // scenarios = append(scenarios, TestScenario{
117- // Name: name,
118- // Traffic: tp.Traffic,
119- // Profile: tp.Profile,
120- // Cluster: *e2e.NewConfig(clusterOfSize1Options...),
121- // })
122- // }
113+ for _ , tp := range trafficProfiles {
114+ name := filepath .Join (tp .Name , "ClusterOfSize1" )
115+ clusterOfSize1Options := baseOptions
116+ clusterOfSize1Options = append (clusterOfSize1Options , e2e .WithClusterSize (1 ))
117+ scenarios = append (scenarios , TestScenario {
118+ Name : name ,
119+ Traffic : tp .Traffic ,
120+ Profile : tp .Profile ,
121+ Cluster : * e2e .NewConfig (clusterOfSize1Options ... ),
122+ })
123+ }
123124
124125 for _ , tp := range trafficProfiles {
125126 name := filepath .Join (tp .Name , "ClusterOfSize3" )
@@ -260,6 +261,7 @@ func Regression(t *testing.T) []TestScenario {
260261 e2e .WithGoFailEnabled (true ),
261262 ),
262263 })
264+
263265 scenarios = append (scenarios , TestScenario {
264266 Name : "Issue18089" ,
265267 Profile : traffic .LowTraffic .WithCompactionPeriod (100 * time .Millisecond ), // Use frequent compaction for high reproduce rate
@@ -270,6 +272,7 @@ func Regression(t *testing.T) []TestScenario {
270272 e2e .WithGoFailEnabled (true ),
271273 ),
272274 })
275+
273276 if v .Compare (version .V3_5 ) >= 0 {
274277 opts := []e2e.EPClusterOption {
275278 e2e .WithSnapshotCount (100 ),
@@ -279,6 +282,7 @@ func Regression(t *testing.T) []TestScenario {
279282 if e2e .CouldSetSnapshotCatchupEntries (e2e .BinPath .Etcd ) {
280283 opts = append (opts , e2e .WithSnapshotCatchUpEntries (100 ))
281284 }
285+
282286 scenarios = append (scenarios , TestScenario {
283287 Name : "Issue15271" ,
284288 Failpoint : failpoint .BlackholeUntilSnapshot ,
@@ -287,5 +291,25 @@ func Regression(t *testing.T) []TestScenario {
287291 Cluster : * e2e .NewConfig (opts ... ),
288292 })
289293 }
294+
295+ scenarios = append (scenarios , TestScenario {
296+ Name : "issue20221" ,
297+ Profile : traffic .HighTrafficProfile .WithoutCompaction (),
298+ Failpoint : failpoint .RaftAfterSaveSnapPanic ,
299+ // Failpoint: failpoint.RaftBeforeApplySnapPanic,
300+ // Failpoint: failpoint.RaftAfterApplySnapPanic,
301+ // Failpoint: failpoint.RaftAfterWALReleasePanic,
302+ Traffic : traffic .Kubernetes ,
303+ Cluster : * e2e .NewConfig (
304+ e2e .WithClusterSize (3 ),
305+ e2e .WithCompactionBatchLimit (10 ),
306+ e2e .WithSnapshotCount (50 ),
307+ e2e .WithSnapshotCatchUpEntries (100 ),
308+ e2e .WithGoFailEnabled (true ),
309+ e2e .WithPeerProxy (true ),
310+ e2e .WithIsPeerTLS (true ),
311+ ),
312+ })
313+
290314 return scenarios
291315}
0 commit comments