fix: Add timeouts to every tailnet ping (#4986)

A ping isn't guaranteed to deliver, so these need to have a
tight timeout for tests to not flake.
This commit is contained in:
Kyle Carberry
2022-11-09 14:12:51 -06:00
committed by GitHub
parent 45f81a7cd5
commit 16e9b1eb1a
4 changed files with 12 additions and 2 deletions

View File

@ -179,6 +179,8 @@ func TestWorkspaceAgentListen(t *testing.T) {
_ = conn.Close()
}()
require.Eventually(t, func() bool {
ctx, cancelFunc := context.WithTimeout(ctx, testutil.IntervalFast)
defer cancelFunc()
_, err := conn.Ping(ctx)
return err == nil
}, testutil.WaitLong, testutil.IntervalFast)