Skip to content

Commit bea95a3

Browse files
committed
Add robustness test scenario for issue #20221 (fix #20229)
Signed-off-by: Chun-Hung Tseng <henrytseng@google.com>
1 parent 405a607 commit bea95a3

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

tests/robustness/Makefile

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ test-robustness-issue19179: /tmp/etcd-v3.5.17-failpoints/bin
7575
GO_TEST_FLAGS='-v -run=TestRobustnessRegression/Issue19179 -count 200 -failfast --bin-dir=/tmp/etcd-v3.5.17-failpoints/bin' $(TOPLEVEL_MAKE) test-robustness && \
7676
echo "Failed to reproduce" || echo "Successful reproduction"
7777

78+
.PHONY: test-robustness-issue20221-fix20229
79+
test-robustness-issue20221-fix20229: /tmp/etcd-bc47e771-failpoints/bin
80+
GO_TEST_FLAGS='-v --run=TestRobustnessRegression/Issue20221_fix20229 --count 100 --failfast --bin-dir=/tmp/etcd-bc47e771-failpoints/bin' $(TOPLEVEL_MAKE) test-robustness && \
81+
echo "Failed to reproduce" || echo "Successful reproduction"
82+
7883
# Etcd API usage by Kubernetes
7984

8085
.PHONY: k8s-coverage
@@ -120,11 +125,25 @@ $(GOPATH)/bin/gofail: $(REPOSITORY_ROOT)/tools/mod/go.mod $(REPOSITORY_ROOT)/too
120125
$(MAKE) gofail-enable; \
121126
$(MAKE) build;
122127

123-
/tmp/etcd-v3.6.0-failpoints/bin: $(GOPATH)/bin/gofail
124-
rm -rf /tmp/etcd-v3.6.0-failpoints/
125-
mkdir -p /tmp/etcd-v3.6.0-failpoints/
126-
cd /tmp/etcd-v3.6.0-failpoints/; \
127-
git clone --depth 1 --branch main https://github.com/etcd-io/etcd.git .; \
128+
# Please keep the version in the target name to enable the autocomplete feature for the Makefile.
129+
/tmp/etcd-v3.6.0-failpoints/bin:
130+
/tmp/etcd-v3.6.%-failpoints/bin: $(GOPATH)/bin/gofail
131+
rm -rf /tmp/etcd-v3.6.$*-failpoints/
132+
mkdir -p /tmp/etcd-v3.6.$*-failpoints/
133+
cd /tmp/etcd-v3.6.$*-failpoints/; \
134+
git clone --depth 1 --branch v3.6.$* https://github.com/etcd-io/etcd.git .; \
135+
$(MAKE) gofail-enable; \
136+
$(MAKE) build;
137+
138+
# Build from specific commit for Issue #20221 Bug A (broke Bookmarkable)
139+
/tmp/etcd-bc47e771-failpoints/bin: $(GOPATH)/bin/gofail
140+
rm -rf /tmp/etcd-bc47e771-failpoints/
141+
mkdir -p /tmp/etcd-bc47e771-failpoints/
142+
cd /tmp/etcd-bc47e771-failpoints/; \
143+
git init; \
144+
git remote add origin https://github.com/etcd-io/etcd.git; \
145+
git fetch --depth 1 origin bc47e7711664ec5557c5ae528d0d02175ea6e166; \
146+
git checkout FETCH_HEAD; \
128147
$(MAKE) gofail-enable; \
129148
$(MAKE) build;
130149

tests/robustness/scenarios/scenarios.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,22 @@ func Regression(t *testing.T) []TestScenario {
271271
e2e.WithGoFailEnabled(true),
272272
),
273273
})
274+
scenarios = append(scenarios, TestScenario{
275+
Name: "Issue20221_fix20229",
276+
Failpoint: failpoint.BlackholeUntilSnapshot,
277+
Watch: client.WatchConfig{
278+
RequestProgress: true,
279+
},
280+
Profile: traffic.HighTrafficProfile,
281+
Traffic: traffic.EtcdPut,
282+
Cluster: *e2e.NewConfig(
283+
e2e.WithSnapshotCount(10),
284+
e2e.WithPeerProxy(true),
285+
e2e.WithIsPeerTLS(true),
286+
e2e.WithWatchProcessNotifyInterval(10*time.Millisecond),
287+
e2e.WithSnapshotCatchUpEntries(10),
288+
),
289+
})
274290
if v.Compare(version.V3_5) >= 0 {
275291
opts := []e2e.EPClusterOption{
276292
e2e.WithSnapshotCount(100),
@@ -288,5 +304,6 @@ func Regression(t *testing.T) []TestScenario {
288304
Cluster: *e2e.NewConfig(opts...),
289305
})
290306
}
307+
291308
return scenarios
292309
}

0 commit comments

Comments
 (0)