info->debug fixes; rearrange integ test wait for connections for hopeful speed improvement

This commit is contained in:
Dan Ballard 2022-12-04 11:06:50 -08:00 committed by Gitea
parent 321b08bfd3
commit 06d402c4d7
3 changed files with 4 additions and 5 deletions

View File

@ -327,7 +327,7 @@ func (cr *contactRetry) handleEvent(id string, state connections.ConnectionState
pinf, _ := cr.connections.Load(id) pinf, _ := cr.connections.Load(id)
p := pinf.(*contact) p := pinf.(*contact)
log.Infof(" managing state change for %v %v to %v by self %v", id, connections.ConnectionStateName[p.state], connections.ConnectionStateName[state], cr.onion) log.Debugf(" managing state change for %v %v to %v by self %v", id, connections.ConnectionStateName[p.state], connections.ConnectionStateName[state], cr.onion)
if state == connections.DISCONNECTED || state == connections.FAILED || state == connections.KILLED { if state == connections.DISCONNECTED || state == connections.FAILED || state == connections.KILLED {
if p.state == connections.SYNCED || p.state == connections.AUTHENTICATED { if p.state == connections.SYNCED || p.state == connections.AUTHENTICATED {
p.lastSeen = time.Now() p.lastSeen = time.Now()

View File

@ -1015,7 +1015,7 @@ func (cp *cwtchPeer) Listen() {
cp.mutex.Lock() cp.mutex.Lock()
defer cp.mutex.Unlock() defer cp.mutex.Unlock()
if !cp.listenStatus { if !cp.listenStatus {
log.Infof("cwtchPeer Listen sending ProtocolEngineStartListen\n") log.Debugf("cwtchPeer Listen sending ProtocolEngineStartListen\n")
cp.listenStatus = true cp.listenStatus = true
onion, _ := cp.storage.LoadProfileKeyValue(TypeAttribute, attr.PublicScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(constants.Onion)).ToString()) onion, _ := cp.storage.LoadProfileKeyValue(TypeAttribute, attr.PublicScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(constants.Onion)).ToString())
cp.eventBus.Publish(event.NewEvent(event.ProtocolEngineStartListen, map[event.Field]string{event.Onion: string(onion)})) cp.eventBus.Publish(event.NewEvent(event.ProtocolEngineStartListen, map[event.Field]string{event.Onion: string(onion)}))

View File

@ -267,9 +267,6 @@ func TestCwtchPeerIntegration(t *testing.T) {
t.Fatalf("Failed to Add Server Bundle %v", err) t.Fatalf("Failed to Add Server Bundle %v", err)
} }
log.Infof("Waiting for alice to join server...")
waitForConnection(t, alice, ServerAddr, connections.SYNCED)
// Creating a Group // Creating a Group
log.Infof("Creating group on %v...", ServerAddr) log.Infof("Creating group on %v...", ServerAddr)
aliceGroupConversationID, err := alice.StartGroup("Our Cool Testing Group", ServerAddr) aliceGroupConversationID, err := alice.StartGroup("Our Cool Testing Group", ServerAddr)
@ -300,6 +297,8 @@ func TestCwtchPeerIntegration(t *testing.T) {
usedTokens += len(bobLines) usedTokens += len(bobLines)
} }
log.Infof("Waiting for alice to join server...")
waitForConnection(t, alice, ServerAddr, connections.SYNCED)
log.Infof("Waiting for Bob to join connect to group server...") log.Infof("Waiting for Bob to join connect to group server...")
waitForConnection(t, bob, ServerAddr, connections.SYNCED) waitForConnection(t, bob, ServerAddr, connections.SYNCED)