Skip to content

Commit 9e95d30

Browse files
committed
Run Issue17780 10 times
Signed-off-by: Marek Siarkowicz <[email protected]>
1 parent 9eb85ee commit 9e95d30

File tree

3 files changed

+17
-178
lines changed

3 files changed

+17
-178
lines changed

tests/robustness/scenarios/scenarios.go

+13-174
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,11 @@
1515
package scenarios
1616

1717
import (
18-
"path/filepath"
1918
"testing"
20-
"time"
2119

22-
"github.com/stretchr/testify/require"
23-
24-
"go.etcd.io/etcd/api/v3/version"
25-
"go.etcd.io/etcd/client/pkg/v3/fileutil"
26-
"go.etcd.io/etcd/server/v3/etcdserver"
2720
"go.etcd.io/etcd/tests/v3/framework/e2e"
2821
"go.etcd.io/etcd/tests/v3/robustness/client"
2922
"go.etcd.io/etcd/tests/v3/robustness/failpoint"
30-
"go.etcd.io/etcd/tests/v3/robustness/options"
31-
"go.etcd.io/etcd/tests/v3/robustness/random"
3223
"go.etcd.io/etcd/tests/v3/robustness/traffic"
3324
)
3425

@@ -70,175 +61,23 @@ type TestScenario struct {
7061
Watch client.WatchConfig
7162
}
7263

73-
func Exploratory(_ *testing.T) []TestScenario {
74-
randomizableOptions := []e2e.EPClusterOption{
75-
options.WithClusterOptionGroups(
76-
options.ClusterOptions{options.WithTickMs(29), options.WithElectionMs(271)},
77-
options.ClusterOptions{options.WithTickMs(101), options.WithElectionMs(521)},
78-
options.ClusterOptions{options.WithTickMs(100), options.WithElectionMs(2000)}),
79-
}
80-
81-
mixedVersionOptionChoices := []random.ChoiceWeight[options.ClusterOptions]{
82-
// 60% with all members of current version
83-
{Choice: options.ClusterOptions{options.WithVersion(e2e.CurrentVersion)}, Weight: 60},
84-
// 10% with 2 members of current version, 1 member last version, leader is current version
85-
{Choice: options.ClusterOptions{options.WithVersion(e2e.MinorityLastVersion), options.WithInitialLeaderIndex(0)}, Weight: 10},
86-
// 10% with 2 members of current version, 1 member last version, leader is last version
87-
{Choice: options.ClusterOptions{options.WithVersion(e2e.MinorityLastVersion), options.WithInitialLeaderIndex(2)}, Weight: 10},
88-
// 10% with 2 members of last version, 1 member current version, leader is last version
89-
{Choice: options.ClusterOptions{options.WithVersion(e2e.QuorumLastVersion), options.WithInitialLeaderIndex(0)}, Weight: 10},
90-
// 10% with 2 members of last version, 1 member current version, leader is current version
91-
{Choice: options.ClusterOptions{options.WithVersion(e2e.QuorumLastVersion), options.WithInitialLeaderIndex(2)}, Weight: 10},
92-
}
93-
mixedVersionOption := options.WithClusterOptionGroups(random.PickRandom[options.ClusterOptions](mixedVersionOptionChoices))
94-
95-
baseOptions := []e2e.EPClusterOption{
96-
options.WithSnapshotCount(50, 100, 1000),
97-
options.WithSubsetOptions(randomizableOptions...),
98-
e2e.WithGoFailEnabled(true),
99-
// Set low minimal compaction batch limit to allow for triggering multi batch compaction failpoints.
100-
options.WithCompactionBatchLimit(10, 100, 1000),
101-
e2e.WithWatchProcessNotifyInterval(100 * time.Millisecond),
102-
}
103-
104-
if e2e.CouldSetSnapshotCatchupEntries(e2e.BinPath.Etcd) {
105-
baseOptions = append(baseOptions, options.WithSnapshotCatchUpEntries(100, etcdserver.DefaultSnapshotCatchUpEntries))
106-
}
107-
scenarios := []TestScenario{}
108-
for _, tp := range trafficProfiles {
109-
name := filepath.Join(tp.Name, "ClusterOfSize1")
110-
clusterOfSize1Options := baseOptions
111-
clusterOfSize1Options = append(clusterOfSize1Options, e2e.WithClusterSize(1))
112-
scenarios = append(scenarios, TestScenario{
113-
Name: name,
114-
Traffic: tp.Traffic,
115-
Profile: tp.Profile,
116-
Cluster: *e2e.NewConfig(clusterOfSize1Options...),
117-
})
118-
}
119-
120-
for _, tp := range trafficProfiles {
121-
name := filepath.Join(tp.Name, "ClusterOfSize3")
122-
clusterOfSize3Options := baseOptions
123-
clusterOfSize3Options = append(clusterOfSize3Options, e2e.WithIsPeerTLS(true))
124-
clusterOfSize3Options = append(clusterOfSize3Options, e2e.WithPeerProxy(true))
125-
if fileutil.Exist(e2e.BinPath.EtcdLastRelease) {
126-
clusterOfSize3Options = append(clusterOfSize3Options, mixedVersionOption)
127-
}
128-
scenarios = append(scenarios, TestScenario{
129-
Name: name,
130-
Traffic: tp.Traffic,
131-
Profile: tp.Profile,
132-
Cluster: *e2e.NewConfig(clusterOfSize3Options...),
133-
})
134-
}
135-
if e2e.BinPath.LazyFSAvailable() {
136-
newScenarios := scenarios
137-
for _, s := range scenarios {
138-
// LazyFS increases the load on CPU, so we run it with more lightweight case.
139-
if s.Profile.MinimalQPS <= 100 && s.Cluster.ClusterSize == 1 {
140-
lazyfsCluster := s.Cluster
141-
lazyfsCluster.LazyFSEnabled = true
142-
newScenarios = append(newScenarios, TestScenario{
143-
Name: filepath.Join(s.Name, "LazyFS"),
144-
Failpoint: s.Failpoint,
145-
Cluster: lazyfsCluster,
146-
Traffic: s.Traffic,
147-
Profile: s.Profile.WithoutCompaction(),
148-
Watch: s.Watch,
149-
})
150-
}
151-
}
152-
scenarios = newScenarios
153-
}
64+
func Exploratory(_ *testing.T) (scenarios []TestScenario) {
15465
return scenarios
15566
}
15667

157-
func Regression(t *testing.T) []TestScenario {
158-
v, err := e2e.GetVersionFromBinary(e2e.BinPath.Etcd)
159-
require.NoErrorf(t, err, "Failed checking etcd version binary, binary: %q", e2e.BinPath.Etcd)
160-
161-
scenarios := []TestScenario{}
162-
scenarios = append(scenarios, TestScenario{
163-
Name: "Issue14370",
164-
Failpoint: failpoint.RaftBeforeSavePanic,
165-
Profile: traffic.LowTraffic,
166-
Traffic: traffic.EtcdPutDeleteLease,
167-
Cluster: *e2e.NewConfig(
168-
e2e.WithClusterSize(1),
169-
e2e.WithGoFailEnabled(true),
170-
),
171-
})
172-
scenarios = append(scenarios, TestScenario{
173-
Name: "Issue14685",
174-
Failpoint: failpoint.DefragBeforeCopyPanic,
175-
Profile: traffic.LowTraffic,
176-
Traffic: traffic.EtcdPutDeleteLease,
177-
Cluster: *e2e.NewConfig(
178-
e2e.WithClusterSize(1),
179-
e2e.WithGoFailEnabled(true),
180-
),
181-
})
182-
scenarios = append(scenarios, TestScenario{
183-
Name: "Issue13766",
184-
Failpoint: failpoint.KillFailpoint,
185-
Profile: traffic.HighTrafficProfile,
186-
Traffic: traffic.EtcdPut,
187-
Cluster: *e2e.NewConfig(
188-
e2e.WithSnapshotCount(100),
189-
),
190-
})
191-
scenarios = append(scenarios, TestScenario{
192-
Name: "Issue15220",
193-
Watch: client.WatchConfig{
194-
RequestProgress: true,
195-
},
196-
Profile: traffic.LowTraffic,
197-
Traffic: traffic.EtcdPutDeleteLease,
198-
Failpoint: failpoint.KillFailpoint,
199-
Cluster: *e2e.NewConfig(
200-
e2e.WithClusterSize(1),
201-
),
202-
})
203-
scenarios = append(scenarios, TestScenario{
204-
Name: "Issue17529",
205-
Profile: traffic.HighTrafficProfile,
206-
Traffic: traffic.Kubernetes,
207-
Failpoint: failpoint.SleepBeforeSendWatchResponse,
208-
Cluster: *e2e.NewConfig(
209-
e2e.WithClusterSize(1),
210-
e2e.WithGoFailEnabled(true),
211-
options.WithSnapshotCount(100),
212-
),
213-
})
214-
215-
scenarios = append(scenarios, TestScenario{
216-
Name: "Issue17780",
217-
Profile: traffic.LowTraffic.WithoutCompaction(),
218-
Failpoint: failpoint.BatchCompactBeforeSetFinishedCompactPanic,
219-
Traffic: traffic.Kubernetes,
220-
Cluster: *e2e.NewConfig(
221-
e2e.WithClusterSize(1),
222-
e2e.WithCompactionBatchLimit(300),
223-
e2e.WithSnapshotCount(1000),
224-
e2e.WithGoFailEnabled(true),
225-
),
226-
})
227-
if v.Compare(version.V3_5) >= 0 {
228-
opts := []e2e.EPClusterOption{
229-
e2e.WithSnapshotCount(100),
230-
e2e.WithPeerProxy(true),
231-
e2e.WithIsPeerTLS(true),
232-
}
233-
if e2e.CouldSetSnapshotCatchupEntries(e2e.BinPath.Etcd) {
234-
opts = append(opts, e2e.WithSnapshotCatchUpEntries(100))
235-
}
68+
func Regression(t *testing.T) (scenarios []TestScenario) {
69+
for i := 0; i < 20; i++ {
23670
scenarios = append(scenarios, TestScenario{
237-
Name: "Issue15271",
238-
Failpoint: failpoint.BlackholeUntilSnapshot,
239-
Profile: traffic.HighTrafficProfile,
240-
Traffic: traffic.EtcdPut,
241-
Cluster: *e2e.NewConfig(opts...),
71+
Name: "Issue17780",
72+
Profile: traffic.LowTraffic.WithoutCompaction(),
73+
Failpoint: failpoint.BatchCompactBeforeSetFinishedCompactPanic,
74+
Traffic: traffic.Kubernetes,
75+
Cluster: *e2e.NewConfig(
76+
e2e.WithClusterSize(1),
77+
e2e.WithCompactionBatchLimit(300),
78+
e2e.WithSnapshotCount(1000),
79+
e2e.WithGoFailEnabled(true),
80+
),
24281
})
24382
}
24483
return scenarios

tests/robustness/traffic/kubernetes.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ var Kubernetes Traffic = kubernetesTraffic{
3939
namespace: "default",
4040
// Please keep the sum of weights equal 100.
4141
writeChoices: []random.ChoiceWeight[KubernetesRequestType]{
42-
{Choice: KubernetesUpdate, Weight: 90},
43-
{Choice: KubernetesDelete, Weight: 5},
44-
{Choice: KubernetesCreate, Weight: 5},
42+
{Choice: KubernetesUpdate, Weight: 50},
43+
{Choice: KubernetesDelete, Weight: 25},
44+
{Choice: KubernetesCreate, Weight: 25},
4545
},
4646
}
4747

tests/robustness/traffic/traffic.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var (
3737
RequestTimeout = 200 * time.Millisecond
3838
WatchTimeout = time.Second
3939
MultiOpTxnOpCount = 4
40-
CompactionPeriod = 200 * time.Millisecond
40+
CompactionPeriod = 50 * time.Millisecond
4141

4242
LowTraffic = Profile{
4343
MinimalQPS: 100,

0 commit comments

Comments
 (0)