diff --git a/Makefile b/Makefile index 1044e776904..874a1db5dd2 100644 --- a/Makefile +++ b/Makefile @@ -129,6 +129,27 @@ gofail-disable: install-gofail install-gofail: cd tools/mod; go install go.etcd.io/gofail@${GOFAIL_VERSION} +# Reproduce historical issues + +.PHONY: reproduce-issue14685 +reproduce-issue14685: ./bin/etcd-v3.5.5-failpoints + cp ./bin/etcd-v3.5.5-failpoints ./bin/etcd + GO_TEST_FLAGS='-v --run=TestLinearizability/Issue14685 --count 100 --failfast' make test-linearizability + +./bin/etcd-v3.5.5-failpoints: + rm -rf /tmp/etcd-release-v3.5.5/ + mkdir -p /tmp/etcd-release-v3.5.5/ + cd /tmp/etcd-release-v3.5.5/; \ + git clone https://github.com/etcd-io/etcd.git .; \ + git checkout v3.5.5; \ + go get go.etcd.io/gofail@${GOFAIL_VERSION}; \ + (cd server; go get go.etcd.io/gofail@${GOFAIL_VERSION}); \ + (cd etcdctl; go get go.etcd.io/gofail@${GOFAIL_VERSION}); \ + (cd etcdutl; go get go.etcd.io/gofail@${GOFAIL_VERSION}); \ + FAILPOINTS=true ./build; + mkdir -p ./bin + cp /tmp/etcd-release-v3.5.5/bin/etcd ./bin/etcd-v3.5.5-failpoints + # Cleanup clean: diff --git a/tests/linearizability/linearizability_test.go b/tests/linearizability/linearizability_test.go index 78780e700c8..3295c9650c3 100644 --- a/tests/linearizability/linearizability_test.go +++ b/tests/linearizability/linearizability_test.go @@ -70,6 +70,14 @@ func TestLinearizability(t *testing.T) { e2e.WithGoFailEnabled(true), ), }, + { + name: "Issue14685", + failpoint: DefragBeforeCopyPanic, + config: *e2e.NewConfig( + e2e.WithClusterSize(1), + e2e.WithGoFailEnabled(true), + ), + }, } for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) {