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 <josh@tailscale.com>
pull/1603/head
Josh Bleecher Snyder 4 years ago committed by Josh Bleecher Snyder
parent 4954fbfda6
commit 0807e3e2f7

@ -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

Loading…
Cancel
Save