aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/protocols
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2019-01-23 23:09:29 +0800
committerGitHub <noreply@github.com>2019-01-23 23:09:29 +0800
commitdc43ea8d0394d9336ea7a3e2a920f3b55bb3189d (patch)
tree91fe94dd3d1131a718ad3ef579d1a5d43348ede1 /p2p/protocols
parenta50b471b6b9c54eba795b74f6d74a09d531af9dc (diff)
downloadgo-tangerine-dc43ea8d0394d9336ea7a3e2a920f3b55bb3189d.tar
go-tangerine-dc43ea8d0394d9336ea7a3e2a920f3b55bb3189d.tar.gz
go-tangerine-dc43ea8d0394d9336ea7a3e2a920f3b55bb3189d.tar.bz2
go-tangerine-dc43ea8d0394d9336ea7a3e2a920f3b55bb3189d.tar.lz
go-tangerine-dc43ea8d0394d9336ea7a3e2a920f3b55bb3189d.tar.xz
go-tangerine-dc43ea8d0394d9336ea7a3e2a920f3b55bb3189d.tar.zst
go-tangerine-dc43ea8d0394d9336ea7a3e2a920f3b55bb3189d.zip
tests: tune flaky tests that error in travis occasionally (#18508)
* tests: tune flaky tests that error in travis occasionally * tests: formatting
Diffstat (limited to 'p2p/protocols')
-rw-r--r--p2p/protocols/protocol_test.go7
-rw-r--r--p2p/protocols/reporter_test.go2
2 files changed, 6 insertions, 3 deletions
diff --git a/p2p/protocols/protocol_test.go b/p2p/protocols/protocol_test.go
index a26222cd8..41845d747 100644
--- a/p2p/protocols/protocol_test.go
+++ b/p2p/protocols/protocol_test.go
@@ -269,8 +269,11 @@ func TestProtocolHook(t *testing.T) {
if !testHook.send {
t.Fatal("Expected a send message, but it is not")
}
- if testHook.peer == nil || testHook.peer.ID() != tester.Nodes[0].ID() {
- t.Fatal("Expected peer ID to be set correctly, but it is not")
+ if testHook.peer == nil {
+ t.Fatal("Expected peer to be set, is nil")
+ }
+ if peerId := testHook.peer.ID(); peerId != tester.Nodes[0].ID() && peerId != tester.Nodes[1].ID() {
+ t.Fatalf("Expected peer ID to be set correctly, but it is not (got %v, exp %v or %v", peerId, tester.Nodes[0].ID(), tester.Nodes[1].ID())
}
if testHook.size != 11 { //11 is the length of the encoded message
t.Fatalf("Expected size to be %d, but it is %d ", 1, testHook.size)
diff --git a/p2p/protocols/reporter_test.go b/p2p/protocols/reporter_test.go
index b9f06e674..8f27d07e8 100644
--- a/p2p/protocols/reporter_test.go
+++ b/p2p/protocols/reporter_test.go
@@ -39,7 +39,7 @@ func TestReporter(t *testing.T) {
//setup the metrics
log.Debug("Setting up metrics first time")
- reportInterval := 5 * time.Millisecond
+ reportInterval := 2 * time.Millisecond
metrics := SetupAccountingMetrics(reportInterval, filepath.Join(dir, "test.db"))
log.Debug("Done.")