mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
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.
This commit is contained in:
@@ -445,7 +445,10 @@ jobs:
|
|||||||
# C: drive is extremely slow: https://github.com/actions/runner-images/issues/8755
|
# C: drive is extremely slow: https://github.com/actions/runner-images/issues/8755
|
||||||
mkdir -p "R:/temp/embedded-pg"
|
mkdir -p "R:/temp/embedded-pg"
|
||||||
go run scripts/embedded-pg/main.go -path "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
|
else
|
||||||
go run scripts/embedded-pg/main.go
|
go run scripts/embedded-pg/main.go
|
||||||
DB=ci gotestsum --format standard-quiet -- -v -short -count=1 ./...
|
DB=ci gotestsum --format standard-quiet -- -v -short -count=1 ./...
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
//go:build !windows
|
|
||||||
|
|
||||||
package testutil
|
package testutil
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -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
|
|
||||||
)
|
|
||||||
Reference in New Issue
Block a user