From 3bd820f2e4feff174641e6df839c244d4378ef33 Mon Sep 17 00:00:00 2001 From: Zoltan Papp Date: Wed, 21 Aug 2024 10:27:02 +0200 Subject: [PATCH] [client] Remove test scenario (#2447) Fix the flickering test. Because we eliminated the direct property, can flicker a test because any output could be valid. Remove unnecessary test cases. --- client/internal/routemanager/client_test.go | 27 --------------------- relay/healthcheck/sender_test.go | 4 ++- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/client/internal/routemanager/client_test.go b/client/internal/routemanager/client_test.go index c4783d5f3..583156e4d 100644 --- a/client/internal/routemanager/client_test.go +++ b/client/internal/routemanager/client_test.go @@ -144,33 +144,6 @@ func TestGetBestrouteFromStatuses(t *testing.T) { currentRoute: "", expectedRouteID: "route1", }, - { - name: "multiple connected peers with one direct", - statuses: map[route.ID]routerPeerStatus{ - "route1": { - connected: true, - relayed: false, - }, - "route2": { - connected: true, - relayed: false, - }, - }, - existingRoutes: map[route.ID]*route.Route{ - "route1": { - ID: "route1", - Metric: route.MaxMetric, - Peer: "peer1", - }, - "route2": { - ID: "route2", - Metric: route.MaxMetric, - Peer: "peer2", - }, - }, - currentRoute: "", - expectedRouteID: "route1", - }, { name: "multiple connected peers with different latencies", statuses: map[route.ID]routerPeerStatus{ diff --git a/relay/healthcheck/sender_test.go b/relay/healthcheck/sender_test.go index 220bb8ac0..5b6db25f6 100644 --- a/relay/healthcheck/sender_test.go +++ b/relay/healthcheck/sender_test.go @@ -2,6 +2,7 @@ package healthcheck import ( "context" + "os" "testing" "time" ) @@ -10,7 +11,8 @@ func TestMain(m *testing.M) { // override the health check interval to speed up the test healthCheckInterval = 1 * time.Second healthCheckTimeout = 100 * time.Millisecond - m.Run() + code := m.Run() + os.Exit(code) } func TestNewHealthPeriod(t *testing.T) {