From f4e5c438b4f3ee227b93becc0077318071b0ed4c Mon Sep 17 00:00:00 2001 From: Kislay Kishore Date: Mon, 26 Aug 2024 14:38:37 +0530 Subject: [PATCH] Add a build workflow to detect flakiness (#2374) * Add flake-detector workflow This workflow runs the same tests 5 times to figure out if there is any flakiness in the tests. --- .github/workflows/flake-detector.yml | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/flake-detector.yml diff --git a/.github/workflows/flake-detector.yml b/.github/workflows/flake-detector.yml new file mode 100644 index 0000000000..af108aa23e --- /dev/null +++ b/.github/workflows/flake-detector.yml @@ -0,0 +1,41 @@ +name: Flake detector +on: + # Enable triggering the workflow manually + workflow_dispatch: + push: + branches: [ "master" ] + +jobs: + codecov: + runs-on: ubuntu-latest + timeout-minutes: 75 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.23.x + cache: false + - name: Install fuse + run: sudo apt-get update && sudo apt-get install -y fuse3 libfuse-dev + - name: Build + run: | + CGO_ENABLED=0 go build ./... + go install ./tools/build_gcsfuse + build_gcsfuse . /tmp ${GITHUB_SHA} + + - name: Download dependencies + run: go mod download + + - name: Test all except caching parallely + run: CGO_ENABLED=0 go test -count 5 -skip `cat flaky_tests.lst | go run tools/scripts/skip_tests/main.go` `go list ./... | grep -v internal/cache/...` + + - name: Test caching + run: CGO_ENABLED=0 go test -p 1 -count 5 -v -skip `cat flaky_tests.lst | go run tools/scripts/skip_tests/main.go` ./internal/cache/... + + - name: Cache RaceDetector Test + run: CGO_ENABLED=0 go test -p 1 -count 5 ./internal/cache/...