Merge pull request #15644 from serathius/robustness-etcdctl-provided

tests/robustness: Ensure that etcdctl binary is provided
This commit is contained in:
Marek Siarkowicz 2023-04-06 07:32:01 +02:00 committed by GitHub
commit 99df35e69b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 15 deletions

View File

@ -25,38 +25,31 @@ jobs:
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with: with:
go-version: '1.19.7' go-version: '1.19.7'
- name: build - name: test-robustness
env: env:
ETCD_BRANCH: "${{ inputs.etcdBranch }}" ETCD_BRANCH: "${{ inputs.etcdBranch }}"
run: | run: |
set -euo pipefail 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 case "${ETCD_BRANCH}" in
release-3.5) release-3.5)
make /tmp/etcd-release-3.5-failpoints/bin/etcd EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness-release-3.5
cp /tmp/etcd-release-3.5-failpoints/bin/etcd bin/etcd
;; ;;
release-3.4) release-3.4)
make /tmp/etcd-release-3.4-failpoints/bin/etcd EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness-release-3.4
cp /tmp/etcd-release-3.4-failpoints/bin/etcd bin/etcd
;; ;;
main) main)
make gofail-enable make gofail-enable
make build 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}" echo "Failed to find target ${ETCD_BRANCH}"
exit 1 exit 1
;; ;;
esac 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 - uses: actions/upload-artifact@v2
if: always() if: always()
with: with:

View File

@ -937,6 +937,7 @@ func (epc *EtcdProcessCluster) WaitMembersForLeader(ctx context.Context, t testi
if err == nil || strings.Contains(err.Error(), "Key not found") { if err == nil || strings.Contains(err.Error(), "Key not found") {
break break
} }
t.Logf("WaitMembersForLeader Get err: %v", err)
} }
leaders := make(map[uint64]struct{}) leaders := make(map[uint64]struct{})

View File

@ -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 # Reproduce historical issues
.PHONY: test-robustness-issue14370 .PHONY: test-robustness-issue14370
@ -63,7 +73,7 @@ install-gofail:
(cd etcdutl; go get go.etcd.io/gofail@${GOFAIL_VERSION}); \ (cd etcdutl; go get go.etcd.io/gofail@${GOFAIL_VERSION}); \
FAILPOINTS=true ./build; 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/ rm -rf /tmp/etcd-release-3.5-failpoints/
mkdir -p /tmp/etcd-release-3.5-failpoints/ mkdir -p /tmp/etcd-release-3.5-failpoints/
cd /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}; \ go get go.etcd.io/gofail@${GOFAIL_VERSION}; \
FAILPOINTS=true ./build; 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/ rm -rf /tmp/etcd-release-3.4-failpoints/
mkdir -p /tmp/etcd-release-3.4-failpoints/ mkdir -p /tmp/etcd-release-3.4-failpoints/
cd /tmp/etcd-release-3.4-failpoints/; \ cd /tmp/etcd-release-3.4-failpoints/; \