diff --git a/.github/workflows/linearizability-nightly.yaml b/.github/workflows/linearizability-nightly.yaml index 0d38b187913..2179b2feaa0 100644 --- a/.github/workflows/linearizability-nightly.yaml +++ b/.github/workflows/linearizability-nightly.yaml @@ -1,25 +1,26 @@ name: Linearizability Nightly on: - # schedules always run against the main branch + # schedules always run against the main branch, hence we have to create separate jobs + # with individual checkout actions for each of the active release branches schedule: - - cron: '25 9 * * *' + - cron: '25 9 * * *' # runs every day at 09:25 UTC jobs: - test: - runs-on: ubuntu-latest + test-main: # GHA has a maximum amount of 6h execution time, we try to get done within 3h - timeout-minutes: 180 - steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 - with: - go-version: "1.19.5" - - run: | - make gofail-enable - make build - mkdir -p /tmp/linearizability - cat server/etcdserver/raft.fail.go - EXPECT_DEBUG=true GO_TEST_FLAGS='-v --count 300 --failfast --run TestLinearizability --timeout=170m' RESULTS_DIR=/tmp/linearizability make test-linearizability - - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - if: always() - with: - path: /tmp/linearizability/* + uses: ./.github/workflows/linearizability-template.yaml + with: + ref: main + count: 300 + timeoutDuration: 170m + test-35: + uses: ./.github/workflows/linearizability-template.yaml + with: + ref: release-3.5 + count: 300 + timeoutDuration: 170m + test-34: + uses: ./.github/workflows/linearizability-template.yaml + with: + ref: release-3.4 + count: 300 + timeoutDuration: 170m diff --git a/.github/workflows/linearizability-template.yaml b/.github/workflows/linearizability-template.yaml new file mode 100644 index 00000000000..f260c12c129 --- /dev/null +++ b/.github/workflows/linearizability-template.yaml @@ -0,0 +1,49 @@ +name: Reusable Linearizability Workflow +on: + workflow_call: + inputs: + ref: + required: true + type: string + count: + required: true + type: number + testTimeout: + required: false + type: string + default: '30m' +permissions: read-all +jobs: + test: + timeout-minutes: 180 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 + with: + go-version: '1.19.5' + - name: build + env: + GITHUB_REF: ${{ inputs.ref }} + run: | + case "${GITHUB_REF}" in + release-3.5) + make build-failpoints-release-3.5 + ./bin/etcd --version + ;; + release-3.4) + make build-failpoints-release-3.4 + ./bin/etcd --version + ;; + *) + make gofail-enable + make build + ;; + esac + - name: test-linearizability + run: | + EXPECT_DEBUG=true GO_TEST_FLAGS='-v --count ${{ inputs.count }} --timeout ${{ inputs.testTimeout }} --failfast --run TestLinearizability' RESULTS_DIR=/tmp/linearizability make test-linearizability + - uses: actions/upload-artifact@v2 + if: always() + with: + path: /tmp/linearizability/* diff --git a/.github/workflows/linearizability.yaml b/.github/workflows/linearizability.yaml index 89bf14ac275..d3cc8a1a9d7 100644 --- a/.github/workflows/linearizability.yaml +++ b/.github/workflows/linearizability.yaml @@ -3,19 +3,8 @@ on: [push, pull_request] permissions: read-all jobs: test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 - with: - go-version: "1.19.5" - - run: | - make gofail-enable - make build - mkdir -p /tmp/linearizability - cat server/etcdserver/raft.fail.go - EXPECT_DEBUG=true GO_TEST_FLAGS='-v --count 60 --failfast --run TestLinearizability' RESULTS_DIR=/tmp/linearizability make test-linearizability - - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - if: always() - with: - path: /tmp/linearizability/* + uses: ./.github/workflows/linearizability-template.yaml + with: + ref: ${{ github.ref }} + count: 60 + testTimeout: 30m diff --git a/Makefile b/Makefile index 1044e776904..6208637b8af 100644 --- a/Makefile +++ b/Makefile @@ -129,6 +129,29 @@ gofail-disable: install-gofail install-gofail: cd tools/mod; go install go.etcd.io/gofail@${GOFAIL_VERSION} +build-failpoints-release-3.5: + rm -rf /tmp/etcd-release-3.5/ + mkdir -p /tmp/etcd-release-3.5/ + cd /tmp/etcd-release-3.5/; \ + git clone --depth 1 --branch release-3.5 https://github.com/etcd-io/etcd.git .; \ + 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-3.5/bin/etcd ./bin/etcd + +build-failpoints-release-3.4: + rm -rf /tmp/etcd-release-3.4/ + mkdir -p /tmp/etcd-release-3.4/ + cd /tmp/etcd-release-3.4/; \ + git clone --depth 1 --branch release-3.4 https://github.com/etcd-io/etcd.git .; \ + go get go.etcd.io/gofail@${GOFAIL_VERSION}; \ + FAILPOINTS=true ./build; + mkdir -p ./bin + cp /tmp/etcd-release-3.4/bin/etcd ./bin/etcd + # Cleanup clean: