From 73fbc858a7a99af95a2697a12695bc866252590d Mon Sep 17 00:00:00 2001 From: j75689 Date: Thu, 21 Oct 2021 12:37:44 +0800 Subject: [PATCH] fix: unit-test failed --- core/blockchain_diff_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/blockchain_diff_test.go b/core/blockchain_diff_test.go index 0b289bdc1c..d2d22bef6e 100644 --- a/core/blockchain_diff_test.go +++ b/core/blockchain_diff_test.go @@ -282,8 +282,9 @@ func TestFreezeDiffLayer(t *testing.T) { defer fullBackend.close() // Minus one empty block. if fullBackend.chain.diffQueue.Size() != blockNum-1 { - t.Errorf("size of diff queue is wrong, expected: %d, get: %d", blockNum, fullBackend.chain.diffQueue.Size()) + t.Errorf("size of diff queue is wrong, expected: %d, get: %d", blockNum-1, fullBackend.chain.diffQueue.Size()) } + time.Sleep(diffLayerFreezerRecheckInterval + 1*time.Second) if fullBackend.chain.diffQueue.Size() != int(fullBackend.chain.triesInMemory) { t.Errorf("size of diff queue is wrong, expected: %d, get: %d", blockNum, fullBackend.chain.diffQueue.Size())