From 0807e3e2f78f16ce65f850c37b44458b5a5e278e Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Sat, 27 Mar 2021 12:17:50 -0700 Subject: [PATCH] syncs: disable TestWatchMultipleValues on Windows CI builds The Windows CI machine experiences significant random execution delays. For example, in this code from watchdog.go: done := make(chan bool) go func() { start := time.Now() mu.Lock() There was a 500ms delay from initializing done to locking mu. This test checks that we receive a sufficient number of events quickly enough. In the face of random 500ms delays, unsurprisingly, the test fails. There's not much principled we can do about it. We could build a system of retries or attempt to detect these random delays, but that game isn't worth the candle. Skip the test. Signed-off-by: Josh Bleecher Snyder --- syncs/watchdog_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/syncs/watchdog_test.go b/syncs/watchdog_test.go index b5cc3452e..116d00625 100644 --- a/syncs/watchdog_test.go +++ b/syncs/watchdog_test.go @@ -6,9 +6,12 @@ package syncs import ( "context" + "runtime" "sync" "testing" "time" + + "tailscale.com/util/cibuild" ) // Time-based tests are fundamentally flaky. @@ -46,6 +49,12 @@ func TestWatchContended(t *testing.T) { } func TestWatchMultipleValues(t *testing.T) { + if cibuild.On() && runtime.GOOS == "windows" { + // On the CI machine, it sometimes takes 500ms to start a new goroutine. + // When this happens, we don't get enough events quickly enough. + // Nothing's wrong, and it's not worth working around. Just skip the test. + t.Skip("flaky on Windows CI") + } mu := new(sync.Mutex) ctx, cancel := context.WithCancel(context.Background()) defer cancel() // not necessary, but keep vet happy