From c290f11e5706a67620afbf966324fb67876258ec Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 11 Nov 2019 14:21:16 +0100 Subject: [PATCH] eth/downloader: try to fix tests --- eth/downloader/downloader_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index cf783f3c4f..9bf17c71f1 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -624,7 +624,6 @@ func testForkedSync(t *testing.T, protocol int, mode SyncMode) { chainB := testChainForkLightB.shorten(testChainBase.len() + 80) tester.newPeer("fork A", protocol, chainA) tester.newPeer("fork B", protocol, chainB) - // Synchronise with the peer and make sure all blocks were retrieved if err := tester.sync("fork A", nil, mode); err != nil { t.Fatalf("failed to synchronise blocks: %v", err) @@ -1002,7 +1001,6 @@ func testInvalidHeaderRollback(t *testing.T, protocol int, mode SyncMode) { t.Parallel() tester := newTester() - defer tester.terminate() // Create a small enough block chain to download targetBlocks := 3*fsHeaderSafetyNet + 256 + fsMinFullBlocks @@ -1082,6 +1080,7 @@ func testInvalidHeaderRollback(t *testing.T, protocol int, mode SyncMode) { t.Fatalf("synchronised blocks mismatch: have %v, want %v", bs, chain.len()) } } + tester.terminate() } // Tests that a peer advertising an high TD doesn't get to stall the downloader @@ -1097,13 +1096,13 @@ func testHighTDStarvationAttack(t *testing.T, protocol int, mode SyncMode) { t.Parallel() tester := newTester() - defer tester.terminate() chain := testChainBase.shorten(1) tester.newPeer("attack", protocol, chain) if err := tester.sync("attack", big.NewInt(1000000), mode); err != errStallingPeer { t.Fatalf("synchronisation error mismatch: have %v, want %v", err, errStallingPeer) } + tester.terminate() } // Tests that misbehaving peers are disconnected, whilst behaving ones are not.