From 412cf98bbcb7387de588e4e949380787af000a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 15 May 2015 21:16:42 +0300 Subject: eth/downloader: fix #992, where tests may time out on a slow machine --- eth/downloader/downloader_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index d55664314..19d64ac67 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -472,6 +472,9 @@ func TestMadeupHashChainAttack(t *testing.T) { // Tests that if a malicious peer makes up a random block chain, and tried to // push indefinitely, it actually gets caught with it. func TestMadeupBlockChainAttack(t *testing.T) { + defaultBlockTTL := blockTTL + defaultCrossCheckCycle := crossCheckCycle + blockTTL = 100 * time.Millisecond crossCheckCycle = 25 * time.Millisecond @@ -490,6 +493,9 @@ func TestMadeupBlockChainAttack(t *testing.T) { t.Fatalf("synchronisation error mismatch: have %v, want %v", err, ErrCrossCheckFailed) } // Ensure that a valid chain can still pass sync + blockTTL = defaultBlockTTL + crossCheckCycle = defaultCrossCheckCycle + tester.hashes = hashes tester.newPeer("valid", big.NewInt(20000), hashes[0]) if _, err := tester.syncTake("valid", hashes[0]); err != nil { -- cgit v1.2.3