forked from cwtch.im/cwtch
Fixing up ContactRetry and Integ Tests
This commit is contained in:
parent
2d9050346b
commit
1e34eb67a7
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue