From 540d012e5e4949dffdaae153a55d85fe303d53ba Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Wed, 5 Apr 2023 15:25:16 +0200 Subject: [PATCH] tests/robustness: Ensure that etcdctl binary is provided Signed-off-by: Marek Siarkowicz --- .github/workflows/robustness-template.yaml | 19 ++++++------------- tests/framework/e2e/cluster.go | 1 + tests/robustness/makefile.mk | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/robustness-template.yaml b/.github/workflows/robustness-template.yaml index 4a3a73d3c..50b861e32 100644 --- a/.github/workflows/robustness-template.yaml +++ b/.github/workflows/robustness-template.yaml @@ -25,38 +25,31 @@ jobs: - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 with: go-version: '1.19.7' - - name: build + - name: test-robustness env: ETCD_BRANCH: "${{ inputs.etcdBranch }}" run: | set -euo pipefail - mkdir -p bin + # Use --failfast to avoid overriding report generated by failed test + GO_TEST_FLAGS="-v --count ${{ inputs.count }} --timeout ${{ inputs.testTimeout }} --failfast --run TestRobustness" case "${ETCD_BRANCH}" in release-3.5) - make /tmp/etcd-release-3.5-failpoints/bin/etcd - cp /tmp/etcd-release-3.5-failpoints/bin/etcd bin/etcd + EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness-release-3.5 ;; release-3.4) - make /tmp/etcd-release-3.4-failpoints/bin/etcd - cp /tmp/etcd-release-3.4-failpoints/bin/etcd bin/etcd + EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness-release-3.4 ;; main) make gofail-enable make build + EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness ;; *) echo "Failed to find target ${ETCD_BRANCH}" exit 1 ;; esac - ./bin/etcd --version - - name: test-robustness - run: | - set -euo pipefail - - # Use --failfast to avoid overriding report generated by failed test - EXPECT_DEBUG=true GO_TEST_FLAGS='-v --count ${{ inputs.count }} --timeout ${{ inputs.testTimeout }} --failfast --run TestRobustness' RESULTS_DIR=/tmp/results make test-robustness - uses: actions/upload-artifact@v2 if: always() with: diff --git a/tests/framework/e2e/cluster.go b/tests/framework/e2e/cluster.go index 019bc4aa5..45907b602 100644 --- a/tests/framework/e2e/cluster.go +++ b/tests/framework/e2e/cluster.go @@ -937,6 +937,7 @@ func (epc *EtcdProcessCluster) WaitMembersForLeader(ctx context.Context, t testi if err == nil || strings.Contains(err.Error(), "Key not found") { break } + t.Logf("WaitMembersForLeader Get err: %v", err) } leaders := make(map[uint64]struct{}) diff --git a/tests/robustness/makefile.mk b/tests/robustness/makefile.mk index acf28e436..fd598e2eb 100644 --- a/tests/robustness/makefile.mk +++ b/tests/robustness/makefile.mk @@ -1,3 +1,13 @@ +# Test previous release branches + +.PHONY: test-robustness-release-3.5 +test-robustness-release-3.5: /tmp/etcd-release-3.5-failpoints/bin + GO_TEST_FLAGS="$${GO_TEST_FLAGS} --bin-dir=/tmp/etcd-release-3.5-failpoints/bin" make test-robustness + +.PHONY: test-robustness-release-3.4 +test-robustness-release-3.4: /tmp/etcd-release-3.4-failpoints/bin + GO_TEST_FLAGS="$${GO_TEST_FLAGS} --bin-dir=/tmp/etcd-release-3.4-failpoints/bin" make test-robustness + # Reproduce historical issues .PHONY: test-robustness-issue14370 @@ -63,7 +73,7 @@ install-gofail: (cd etcdutl; go get go.etcd.io/gofail@${GOFAIL_VERSION}); \ FAILPOINTS=true ./build; -/tmp/etcd-release-3.5-failpoints/bin/etcd: install-gofail +/tmp/etcd-release-3.5-failpoints/bin: install-gofail rm -rf /tmp/etcd-release-3.5-failpoints/ mkdir -p /tmp/etcd-release-3.5-failpoints/ cd /tmp/etcd-release-3.5-failpoints/; \ @@ -83,7 +93,7 @@ install-gofail: go get go.etcd.io/gofail@${GOFAIL_VERSION}; \ FAILPOINTS=true ./build; -/tmp/etcd-release-3.4-failpoints/bin/etcd: install-gofail +/tmp/etcd-release-3.4-failpoints/bin: install-gofail rm -rf /tmp/etcd-release-3.4-failpoints/ mkdir -p /tmp/etcd-release-3.4-failpoints/ cd /tmp/etcd-release-3.4-failpoints/; \