Skip to content

Commit

Permalink
fix(ci): e2e test with p2p network
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Mar 8, 2019
1 parent 8aaab09 commit a0f2b93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions core/network/host/routing.go
Expand Up @@ -9,7 +9,6 @@ import (
cid "github.com/ipfs/go-cid"
datastore "github.com/ipfs/go-datastore"
syncdatastore "github.com/ipfs/go-datastore/sync"
log "github.com/ipfs/go-log"
host "github.com/libp2p/go-libp2p-host"
kaddht "github.com/libp2p/go-libp2p-kad-dht"
inet "github.com/libp2p/go-libp2p-net"
Expand Down Expand Up @@ -39,7 +38,7 @@ type BertyRouting struct {
}

func init() {
log.SetDebugLogging()
// log.SetDebugLogging()
}

func NewBertyRouting(ctx context.Context, h host.Host, dhtSvc bool) (*BertyRouting, error) {
Expand Down
6 changes: 5 additions & 1 deletion core/test/e2e_test.go
Expand Up @@ -826,7 +826,11 @@ func TestAliasesFlow(t *testing.T) {
}

func setupP2PNetwork(ctx context.Context) (*p2pnet.Network, error) {
return p2pnet.New(ctx, p2pnet.WithDefaultOptions(), p2pnet.DisableDefaultBootstrap())
return p2pnet.New(ctx,
p2pnet.WithDefaultOptions(),
p2pnet.DisableDHT(),
p2pnet.DisableHOP(),
)
}

func getBootstrap(ctx context.Context, n *p2pnet.Network) []string {
Expand Down
3 changes: 2 additions & 1 deletion core/test/scenario_test.go
Expand Up @@ -79,7 +79,7 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
})
Convey("Alice has Bob as friend", FailureHalts, func() {
shouldIContinue(t)
time.Sleep(200 * time.Millisecond)
time.Sleep(500 * time.Millisecond)

contacts, err := alice.client.ContactList(internalCtx, &node.ContactListInput{
Filter: &entity.Contact{Status: entity.Contact_IsFriend},
Expand Down Expand Up @@ -264,6 +264,7 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
Convey("Bob has one message in conversation history", FailureHalts, func() {
shouldIContinue(t)

time.Sleep(4 * time.Second)
So(cache["conversation_id"], ShouldNotBeNil)
events, err := bob.client.EventList(internalCtx, &node.EventListInput{
Filter: &entity.Event{
Expand Down

0 comments on commit a0f2b93

Please sign in to comment.