Skip to content

Commit

Permalink
eth/downloader: fix ethereum#992, where tests may time out on a slow …
Browse files Browse the repository at this point in the history
…machine
  • Loading branch information
karalabe committed May 15, 2015
1 parent 9899853 commit 412cf98
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions eth/downloader/downloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 {
Expand Down

0 comments on commit 412cf98

Please sign in to comment.