From daea5128c00798903aca7c574edbebe916ed6b4a Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 2 Jan 2024 12:45:39 -0800 Subject: [PATCH] Fixup Connection Test to check reconnecting status --- app/plugins/contactRetry_test.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/app/plugins/contactRetry_test.go b/app/plugins/contactRetry_test.go index 946ced8..0ebbd72 100644 --- a/app/plugins/contactRetry_test.go +++ b/app/plugins/contactRetry_test.go @@ -64,18 +64,9 @@ func TestContactRetryQueue(t *testing.T) { // If we didn't do this we would have to wait 30 seconds for a check-in bus.Publish(event.NewEvent(event.PeerStateChange, map[event.Field]string{event.RemotePeer: "test2", event.ConnectionState: "Disconnected"})) time.Sleep(time.Second) - if pinf.(*contact).queued != false { - t.Fatalf("test connection should not be queued, actually: %v", pinf.(*contact).queued) - } - - // Publish a new peer request... - bus.Publish(event.NewEvent(event.QueuePeerRequest, map[event.Field]string{event.RemotePeer: testOnion})) - time.Sleep(time.Second) // yield for a second so the event can catch up... - - // Peer test should be forced to queue.... pinf, _ = cr.connections.Load(testOnion) - if pinf.(*contact).queued != true { - t.Fatalf("test connection should be forced to queue after new queue peer request") + if pinf.(*contact).state != 1 { + t.Fatalf("test connection should be in connecting after update, actually: %v", pinf.(*contact).state) } cr.Shutdown()