Fix Contact Retry Failure to Restart #541

Merged
sarah merged 17 commits from post-stable-fixes into master 2024-01-02 23:18:00 +00:00
1 changed files with 2 additions and 11 deletions
Showing only changes of commit daea5128c0 - Show all commits

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