diff --git a/app/plugins/contactRetry.go b/app/plugins/contactRetry.go index 2592f68..369f9a8 100644 --- a/app/plugins/contactRetry.go +++ b/app/plugins/contactRetry.go @@ -3,7 +3,6 @@ package plugins import ( "cwtch.im/cwtch/event" "cwtch.im/cwtch/protocol/connections" - "git.openprivacy.ca/openprivacy/log" "sync" "time" ) @@ -57,13 +56,11 @@ func (cr *contactRetry) run() { case e := <-cr.queue.OutChan(): switch e.EventType { case event.PeerStateChange: - log.Errorf("PEER STATE CHANGE: %v", e) state := connections.ConnectionStateToType[e.Data[event.ConnectionState]] peer := e.Data[event.RemotePeer] cr.handleEvent(peer, state, peerConn) case event.ServerStateChange: - log.Errorf("SERVER STATE CHANGE: %v", e) state := connections.ConnectionStateToType[e.Data[event.ConnectionState]] server := e.Data[event.GroupServer] cr.handleEvent(server, state, serverConn) @@ -97,8 +94,6 @@ func (cr *contactRetry) run() { if cr.networkUp { if p.ctype == peerConn { cr.bus.Publish(event.NewEvent(event.RetryPeerRequest, map[event.Field]string{event.RemotePeer: p.id})) - } else { - //cr.bus.Publish(event.NewEventList(event.JoinServer, event.GroupServer, p.id)) } } } diff --git a/testing/cwtch_peer_server_integration_test.go b/testing/cwtch_peer_server_integration_test.go index 0173e56..4f5dc65 100644 --- a/testing/cwtch_peer_server_integration_test.go +++ b/testing/cwtch_peer_server_integration_test.go @@ -348,16 +348,18 @@ func TestCwtchPeerIntegration(t *testing.T) { fmt.Printf("%v> %v", bobName, bobLines[2]) bob.SendMessageToGroup(groupID, bobLines[2]) - time.Sleep(time.Second * 60) // we need to account for spam-based token acquisition + // Bob should have enough tokens so we don't need to account for + // token acquisition here... fmt.Printf("%v> %v", carolName, carolLines[0]) carol.SendMessageToGroup(groupID, carolLines[0]) - time.Sleep(time.Second * 60) // we need to account for spam-based token acquisition + time.Sleep(time.Second * 30) // we need to account for spam-based token acquisition, but everything should + // be warmed-up and delays should be pretty small. // ***** Verify Test ***** fmt.Println("Final syncing time...") - time.Sleep(time.Second * 60) + time.Sleep(time.Second * 30) alicesGroup := alice.GetGroup(groupID) if alicesGroup == nil {