From 899836d47a73107436c92b2db37a6c8d03db4971 Mon Sep 17 00:00:00 2001 From: Hugo Dutka Date: Fri, 10 Jan 2025 15:21:03 +0100 Subject: [PATCH] chore: reduce Windows PG tests flakiness (#16090) This PR: - Reduces test parallelism on Windows in CI - Unifies wait intervals on Windows with Linux and macOS. Previously we had custom intervals for Windows to reduce test flakiness on smaller CI workers, but we don't run tests on small CI workers anymore. Due to how our CI file is defined, forks run tests on small CI machines, but I'm not sure if the different intervals actually help or whether that's a heuristic that happened to fix issues on a particular day and was it ever reevaluated. I propose we make the change and if someone complains, revert it. In particular, reduced test parallelism seems to actually help: I was able to run Windows tests 5 times in a row without flakes. Not sure if that's going to fix the problem long term, but it seems worth trying. --- .github/workflows/ci.yaml | 5 ++++- testutil/duration.go | 2 -- testutil/duration_windows.go | 24 ------------------------ 3 files changed, 4 insertions(+), 27 deletions(-) delete mode 100644 testutil/duration_windows.go diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e5180b037a..5492a2354e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -445,7 +445,10 @@ jobs: # C: drive is extremely slow: https://github.com/actions/runner-images/issues/8755 mkdir -p "R:/temp/embedded-pg" go run scripts/embedded-pg/main.go -path "R:/temp/embedded-pg" - DB=ci gotestsum --format standard-quiet -- -v -short -count=1 ./... + # Reduce test parallelism, mirroring what we do for race tests. + # We'd been encountering issues with timing related flakes, and + # this seems to help. + DB=ci gotestsum --format standard-quiet -- -v -short -count=1 -parallel 4 -p 4 ./... else go run scripts/embedded-pg/main.go DB=ci gotestsum --format standard-quiet -- -v -short -count=1 ./... diff --git a/testutil/duration.go b/testutil/duration.go index 44ae418eba..a8c35030cd 100644 --- a/testutil/duration.go +++ b/testutil/duration.go @@ -1,5 +1,3 @@ -//go:build !windows - package testutil import ( diff --git a/testutil/duration_windows.go b/testutil/duration_windows.go deleted file mode 100644 index d363dae2ba..0000000000 --- a/testutil/duration_windows.go +++ /dev/null @@ -1,24 +0,0 @@ -package testutil - -import "time" - -// Constants for timing out operations, usable for creating contexts -// that timeout or in require.Eventually. -// -// Windows durations are adjusted for slow CI workers. -const ( - WaitShort = 30 * time.Second - WaitMedium = 40 * time.Second - WaitLong = 70 * time.Second - WaitSuperLong = 240 * time.Second -) - -// Constants for delaying repeated operations, e.g. in -// require.Eventually. -// -// Windows durations are adjusted for slow CI workers. -const ( - IntervalFast = 100 * time.Millisecond - IntervalMedium = 1000 * time.Millisecond - IntervalSlow = 4 * time.Second -)