mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-22 20:21:04 +02:00
Revert error handling behaviour in test to support auto net.Conn creation
This commit is contained in:
@@ -314,8 +314,8 @@ func TestBindToUnavailabePeer(t *testing.T) {
|
|||||||
t.Errorf("failed to connect to server: %s", err)
|
t.Errorf("failed to connect to server: %s", err)
|
||||||
}
|
}
|
||||||
_, err = clientAlice.OpenConn(ctx, "bob")
|
_, err = clientAlice.OpenConn(ctx, "bob")
|
||||||
if err == nil {
|
if err != nil {
|
||||||
t.Errorf("expected error when binding to unavailable peer, got nil")
|
t.Errorf("failed to open bob: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("closing client")
|
log.Infof("closing client")
|
||||||
|
@@ -285,15 +285,15 @@ func TestForeginAutoClose(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
t.Log("open connection to another peer")
|
t.Log("open connection to another peer")
|
||||||
if _, err = mgr.OpenConn(ctx, toURL(srvCfg2)[0], "anotherpeer"); err == nil {
|
if _, err = mgr.OpenConn(ctx, toURL(srvCfg2)[0], "anotherpeer"); err != nil {
|
||||||
t.Fatalf("should have failed to open connection to another peer")
|
t.Fatalf("failed to open connection: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout := relayCleanupInterval + keepUnusedServerTime + 1*time.Second
|
timeout := relayCleanupInterval + keepUnusedServerTime + 1*time.Second
|
||||||
t.Logf("waiting for relay cleanup: %s", timeout)
|
t.Logf("waiting for relay cleanup: %s", timeout)
|
||||||
time.Sleep(timeout)
|
time.Sleep(timeout)
|
||||||
if len(mgr.relayClients) != 0 {
|
if len(mgr.relayClients) != 1 {
|
||||||
t.Errorf("expected 0, got %d", len(mgr.relayClients))
|
t.Errorf("expected 1 relay client, got %d", len(mgr.relayClients))
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Logf("closing manager")
|
t.Logf("closing manager")
|
||||||
|
Reference in New Issue
Block a user