Don't automatically run file sharing integration test (for now)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is failing Details

We either need to reduce the time these tests take or bump up drone timeouts
This commit is contained in:
Sarah Jamie Lewis 2021-09-10 09:11:43 -07:00
parent b389a3421a
commit 38dd63abd9
1 changed files with 27 additions and 1 deletions

View File

@ -1,4 +1,4 @@
package testing
package file_sharing
import (
"crypto/rand"
@ -7,6 +7,9 @@ import (
"cwtch.im/cwtch/event"
"cwtch.im/cwtch/functionality/filesharing"
"cwtch.im/cwtch/model"
"cwtch.im/cwtch/model/attr"
"cwtch.im/cwtch/peer"
"cwtch.im/cwtch/protocol/connections"
"cwtch.im/cwtch/protocol/files"
"encoding/base64"
"encoding/hex"
@ -24,6 +27,29 @@ import (
"time"
)
func waitForPeerPeerConnection(t *testing.T, peera peer.CwtchPeer, peerb peer.CwtchPeer) {
for {
state, ok := peera.GetPeerState(peerb.GetOnion())
if ok {
//log.Infof("Waiting for Peer %v to peer with peer: %v - state: %v\n", peera.GetProfile().Name, peerb.GetProfile().Name, state)
if state == connections.FAILED {
t.Fatalf("%v could not connect to %v", peera.GetOnion(), peerb.GetOnion())
}
if state != connections.AUTHENTICATED {
fmt.Printf("peer %v waiting connect to peer %v, currently: %v\n", peera.GetOnion(), peerb.GetOnion(), connections.ConnectionStateName[state])
time.Sleep(time.Second * 5)
continue
} else {
peerAName, _ := peera.GetAttribute(attr.GetLocalScope("name"))
peerBName, _ := peerb.GetAttribute(attr.GetLocalScope("name"))
fmt.Printf("%v CONNECTED and AUTHED to %v\n", peerAName, peerBName)
break
}
}
}
return
}
func TestFileSharing(t *testing.T) {
numGoRoutinesStart := runtime.NumGoroutine()