From 06e4e93185fbf0ec06fdb7590577fc35d20dccbc Mon Sep 17 00:00:00 2001 From: Matthias Hanel Date: Thu, 19 Nov 2020 16:58:53 -0500 Subject: [PATCH] Speeding up unit test fail case Signed-off-by: Matthias Hanel --- test/tls_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/tls_test.go b/test/tls_test.go index 71bcc6a6..06933110 100644 --- a/test/tls_test.go +++ b/test/tls_test.go @@ -850,9 +850,10 @@ func testTLSRoutesCertificateImplicitAllow(t *testing.T, pass bool) { checkNumRoutes(t, srvA, 1) checkNumRoutes(t, srvB, 1) } else { - time.Sleep(5 * time.Second) - checkNumRoutes(t, srvA, 0) - checkNumRoutes(t, srvB, 0) + time.Sleep(1 * time.Second) // the fail case uses the IP, so a short wait is sufficient + if srvA.NumRoutes() != 0 || srvB.NumRoutes() != 0 { + t.Fatal("No route connection expected") + } } } @@ -947,9 +948,10 @@ func testTLSGatewaysCertificateImplicitAllow(t *testing.T, pass bool) { waitForOutboundGateways(t, srvA, 1, 5*time.Second) waitForOutboundGateways(t, srvB, 1, 5*time.Second) } else { - time.Sleep(5 * time.Second) - waitForOutboundGateways(t, srvA, 0, 1*time.Second) - waitForOutboundGateways(t, srvB, 0, 1*time.Second) + time.Sleep(1 * time.Second) // the fail case uses the IP, so a short wait is sufficient + if srvA.NumOutboundGateways() != 0 || srvB.NumOutboundGateways() != 0 { + t.Fatal("No outbound gateway connection expected") + } } }