From 9bc57439be2f4f12daafd64b091f578b9117081a Mon Sep 17 00:00:00 2001 From: Igor Mandrigin Date: Fri, 11 Sep 2020 17:36:59 +0200 Subject: [PATCH] fix tests (downloader) --- eth/downloader/downloader_test.go | 12 +++++------- eth/downloader/testchain_test.go | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index a75a259cc..09d63e320 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -40,17 +40,15 @@ import ( "github.com/stretchr/testify/assert" ) -const OwerwriteBlockCacheItems = 1024 -const OwerwriteMaxForkAncestry = 3000 +const OverwriteBlockCacheItems = 1024 +const OverwriteMaxForkAncestry = 3000 // Reduce some of the parameters to make the tester faster. func init() { - blockCacheItems = OwerwriteBlockCacheItems + blockCacheMaxItems = OverwriteBlockCacheItems fsHeaderSafetyNet = 256 fsHeaderContCheck = 50 * time.Millisecond - fullMaxForkAncestry = 10000 - lightMaxForkAncestry = 10000 - blockCacheMaxItems = 1024 + fullMaxForkAncestry = OverwriteMaxForkAncestry fsHeaderContCheck = 500 * time.Millisecond } @@ -1277,7 +1275,7 @@ func testFailedSyncProgress(t *testing.T, protocol int, mode SyncMode) { defer tester.terminate() defer tester.peerDb.Close() - chain := testChainBase.shorten(blockCacheItems - 15) + chain := testChainBase.shorten(blockCacheMaxItems - 15) // Set a sync init hook to catch progress changes starting := make(chan struct{}) diff --git a/eth/downloader/testchain_test.go b/eth/downloader/testchain_test.go index 15ffcfe88..38b06b8b0 100644 --- a/eth/downloader/testchain_test.go +++ b/eth/downloader/testchain_test.go @@ -43,7 +43,7 @@ var ( ) // The common prefix of all test chains: -var testChainBase = newTestChain(OwerwriteBlockCacheItems+200, testDb, testGenesis) +var testChainBase = newTestChain(OverwriteBlockCacheItems+200, testDb, testGenesis) // Different forks on top of the base chain: var testChainForkLightA, testChainForkLightB, testChainForkHeavy *testChain