Fixup Connection Test to check reconnecting status
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Sarah Jamie Lewis 2024-01-02 12:45:39 -08:00
parent 347ac3cf48
commit daea5128c0
1 changed files with 2 additions and 11 deletions

View File

@ -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"}))
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)