diff options
| author | Simeng He <simeng@tailscale.com> | 2021-06-09 10:13:11 -0400 |
|---|---|---|
| committer | Simeng He <simeng@tailscale.com> | 2021-06-09 12:50:27 -0400 |
| commit | 3f9c808ea1c5d662a947e37e973e6ce9e737d5d5 (patch) | |
| tree | 1b44df42897524f8adcd0bf4f0dcbfd583c5880f | |
| parent | 8b11937eafb84d00e266cb52dfc1355c8738665c (diff) | |
| download | tailscale-simenghe/flakeresolve.tar.xz tailscale-simenghe/flakeresolve.zip | |
tstest/integration: fix TestAddPingRequest flakingsimenghe/flakeresolve
Added a ticker to readd PingRequests if the previous one was stuck
Signed-off-by: Simeng He <simeng@tailscale.com>
| -rw-r--r-- | tstest/integration/integration_test.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tstest/integration/integration_test.go b/tstest/integration/integration_test.go index d2f3e6189..9d2546cfe 100644 --- a/tstest/integration/integration_test.go +++ b/tstest/integration/integration_test.go @@ -258,10 +258,21 @@ func TestAddPingRequest(t *testing.T) { } // Wait for PingRequest to come back - pingTimeout := time.NewTimer(10 * time.Second) + waitDuration := 10 * time.Second + pingTimeout := time.NewTimer(waitDuration) + + // Ticker sends new PingRequests if the previous did not get through + ticker := time.NewTicker(waitDuration / 5) + select { case <-gotPing: pingTimeout.Stop() + ticker.Stop() + case <-ticker.C: + ok := env.Control.AddPingRequest(nodeKey, pr) + if !ok { + t.Fatalf("no node found with NodeKey %v in AddPingRequest", nodeKey) + } case <-pingTimeout.C: t.Error("didn't get PingRequest from tailscaled") } |
