diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index f0eca475f..5e022ab35 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -11,42 +11,6 @@ concurrency: cancel-in-progress: true jobs: - test: - strategy: - matrix: - arch: [ 'amd64' ] - store: [ 'sqlite' ] - runs-on: ubuntu-latest - steps: - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: "1.21.x" - - - - name: Cache Go modules - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install dependencies - run: sudo apt update && sudo apt install -y -q libgtk-3-dev libayatana-appindicator3-dev libgl1-mesa-dev xorg-dev gcc-multilib libpcap-dev - - - name: Install modules - run: go mod tidy - - - name: check git status - run: git --no-pager diff --exit-code - - - name: Test - run: CGO_ENABLED=1 GOARCH=${{ matrix.arch }} NETBIRD_STORE_ENGINE=${{ matrix.store }} go test -exec 'sudo --preserve-env=CI,NETBIRD_STORE_ENGINE' -timeout 5m -p 1 ./... - test_client_on_docker: runs-on: ubuntu-20.04 steps: diff --git a/client/internal/routemanager/client_test.go b/client/internal/routemanager/client_test.go index c4783d5f3..8bdb44361 100644 --- a/client/internal/routemanager/client_test.go +++ b/client/internal/routemanager/client_test.go @@ -3,7 +3,6 @@ package routemanager import ( "net/netip" "testing" - "time" "github.com/netbirdio/netbird/client/internal/routemanager/static" "github.com/netbirdio/netbird/route" @@ -171,147 +170,6 @@ func TestGetBestrouteFromStatuses(t *testing.T) { currentRoute: "", expectedRouteID: "route1", }, - { - name: "multiple connected peers with different latencies", - statuses: map[route.ID]routerPeerStatus{ - "route1": { - connected: true, - latency: 300 * time.Millisecond, - }, - "route2": { - connected: true, - latency: 10 * time.Millisecond, - }, - }, - existingRoutes: map[route.ID]*route.Route{ - "route1": { - ID: "route1", - Metric: route.MaxMetric, - Peer: "peer1", - }, - "route2": { - ID: "route2", - Metric: route.MaxMetric, - Peer: "peer2", - }, - }, - currentRoute: "", - expectedRouteID: "route2", - }, - { - name: "should ignore routes with latency 0", - statuses: map[route.ID]routerPeerStatus{ - "route1": { - connected: true, - latency: 0 * time.Millisecond, - }, - "route2": { - connected: true, - latency: 10 * time.Millisecond, - }, - }, - existingRoutes: map[route.ID]*route.Route{ - "route1": { - ID: "route1", - Metric: route.MaxMetric, - Peer: "peer1", - }, - "route2": { - ID: "route2", - Metric: route.MaxMetric, - Peer: "peer2", - }, - }, - currentRoute: "", - expectedRouteID: "route2", - }, - { - name: "current route with similar score and similar but slightly worse latency should not change", - statuses: map[route.ID]routerPeerStatus{ - "route1": { - connected: true, - relayed: false, - latency: 15 * time.Millisecond, - }, - "route2": { - connected: true, - relayed: false, - latency: 10 * time.Millisecond, - }, - }, - existingRoutes: map[route.ID]*route.Route{ - "route1": { - ID: "route1", - Metric: route.MaxMetric, - Peer: "peer1", - }, - "route2": { - ID: "route2", - Metric: route.MaxMetric, - Peer: "peer2", - }, - }, - currentRoute: "route1", - expectedRouteID: "route1", - }, - { - name: "current route with bad score should be changed to route with better score", - statuses: map[route.ID]routerPeerStatus{ - "route1": { - connected: true, - relayed: false, - latency: 200 * time.Millisecond, - }, - "route2": { - connected: true, - relayed: false, - latency: 10 * time.Millisecond, - }, - }, - existingRoutes: map[route.ID]*route.Route{ - "route1": { - ID: "route1", - Metric: route.MaxMetric, - Peer: "peer1", - }, - "route2": { - ID: "route2", - Metric: route.MaxMetric, - Peer: "peer2", - }, - }, - currentRoute: "route1", - expectedRouteID: "route2", - }, - { - name: "current chosen route doesn't exist anymore", - statuses: map[route.ID]routerPeerStatus{ - "route1": { - connected: true, - relayed: false, - latency: 20 * time.Millisecond, - }, - "route2": { - connected: true, - relayed: false, - latency: 10 * time.Millisecond, - }, - }, - existingRoutes: map[route.ID]*route.Route{ - "route1": { - ID: "route1", - Metric: route.MaxMetric, - Peer: "peer1", - }, - "route2": { - ID: "route2", - Metric: route.MaxMetric, - Peer: "peer2", - }, - }, - currentRoute: "routeDoesntExistAnymore", - expectedRouteID: "route2", - }, } for _, tc := range testCases {