Fixup Connection Test to check reconnecting status
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
347ac3cf48
commit
daea5128c0
|
@ -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
|
// 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"}))
|
bus.Publish(event.NewEvent(event.PeerStateChange, map[event.Field]string{event.RemotePeer: "test2", event.ConnectionState: "Disconnected"}))
|
||||||
time.Sleep(time.Second)
|
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)
|
pinf, _ = cr.connections.Load(testOnion)
|
||||||
if pinf.(*contact).queued != true {
|
if pinf.(*contact).state != 1 {
|
||||||
t.Fatalf("test connection should be forced to queue after new queue peer request")
|
t.Fatalf("test connection should be in connecting after update, actually: %v", pinf.(*contact).state)
|
||||||
}
|
}
|
||||||
|
|
||||||
cr.Shutdown()
|
cr.Shutdown()
|
||||||
|
|
Loading…
Reference in New Issue