Skip to content

Commit 64cdeaa

Browse files
committed
Monkey patch
Open watch every time on all nodes .
1 parent a56b7dc commit 64cdeaa

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

tests/robustness/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ test-robustness-issue20573: /tmp/etcd-v3.6.4-failpoints/bin
8282

8383
.PHONY: test-robustness-issue20221
8484
test-robustness-issue20221: /tmp/etcd-866bc0717c0b56579514c7363f3f47f6cd4109c6-failpoints/bin
85-
GO_TEST_FLAGS='-v -run=TestRobustnessRegression/issue20221 -count 200 -failfast --bin-dir=/tmp/etcd-866bc0717c0b56579514c7363f3f47f6cd4109c6-failpoints/bin' $(TOPLEVEL_MAKE) test-robustness && \
85+
GO_TEST_FLAGS='-v -run=TestRobustnessRegression/issue20221 -count 200 -failfast -timeout 10h --bin-dir=/tmp/etcd-866bc0717c0b56579514c7363f3f47f6cd4109c6-failpoints/bin' $(TOPLEVEL_MAKE) test-robustness && \
8686
echo "Failed to reproduce" || echo "Successful reproduction"
8787

8888
# Etcd API usage by Kubernetes

tests/robustness/client/watch.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"context"
1919
"errors"
2020
"fmt"
21+
"os"
2122
"time"
2223

2324
"go.uber.org/zap"
@@ -153,6 +154,7 @@ func openWatchPeriodically(ctx context.Context, g *errgroup.Group, c *RecordingC
153154
for {
154155
select {
155156
case <-ctx.Done():
157+
os.Exit(1)
156158
return ctx.Err()
157159
case <-finish:
158160
return nil

tests/robustness/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func runScenario(ctx context.Context, t *testing.T, s scenarios.TestScenario, lg
179179
})
180180
err := g.Wait()
181181
if err != nil {
182-
t.Error(err)
182+
// t.Error(err)
183183
}
184184

185185
err = client.CheckEndOfTestHashKV(ctx, clus)

tests/robustness/scenarios/scenarios.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ func Regression(t *testing.T) []TestScenario {
294294

295295
scenarios = append(scenarios, TestScenario{
296296
Name: "issue20573",
297-
Profile: traffic.HighTrafficProfile.WithoutCompaction().WithContinuousWatchCreationInterval(10 * time.Millisecond).WithContinuousWatchCreationRevisionOffset(-10),
297+
Profile: traffic.HighTrafficProfile.WithoutCompaction().WithBackgroundWatchConfigInterval(10 * time.Millisecond).WithBackgroundWatchConfigRevisionOffset(-10),
298298
Failpoint: failpoint.RaftAfterSaveSnapPanic,
299299
Traffic: traffic.Kubernetes,
300300
Cluster: *e2e.NewConfig(
@@ -309,10 +309,10 @@ func Regression(t *testing.T) []TestScenario {
309309
})
310310

311311
scenarios = append(scenarios, TestScenario{
312-
Name: "issue20221",
313-
Profile: traffic.HighTrafficProfile.WithoutCompaction().WithContinuousWatchCreationInterval(10 * time.Millisecond).WithContinuousWatchCreationRevisionOffset(100),
314-
Failpoint: failpoint.RaftAfterSaveSnapPanic,
315-
// Failpoint: failpoint.RaftBeforeApplySnapPanic,
312+
Name: "issue20221",
313+
Profile: traffic.HighTrafficProfile.WithoutCompaction().WithBackgroundWatchConfigInterval(5 * time.Millisecond).WithBackgroundWatchConfigRevisionOffset(5),
314+
// Failpoint: failpoint.RaftAfterSaveSnapPanic,
315+
Failpoint: failpoint.RaftBeforeApplySnapPanic,
316316
// Failpoint: failpoint.RaftAfterApplySnapPanic,
317317
// Failpoint: failpoint.RaftAfterWALReleasePanic,
318318
Traffic: traffic.Kubernetes,

0 commit comments

Comments
 (0)