From fdd7988e94f46081db733ada1c2cc3682662bd10 Mon Sep 17 00:00:00 2001 From: Raneet Debnath Date: Wed, 12 Oct 2022 09:29:40 +0530 Subject: [PATCH] fix: PR comments --- tests/bor/bor_reorg_test.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/bor/bor_reorg_test.go b/tests/bor/bor_reorg_test.go index 7b7c25fab9..f68566ee5f 100644 --- a/tests/bor/bor_reorg_test.go +++ b/tests/bor/bor_reorg_test.go @@ -139,7 +139,7 @@ func TestValidatorWentOffline(t *testing.T) { // Start the node and wait until it's up stack, ethBackend, err := initMiner(genesis, keys[i]) if err != nil { - panic(err) + t.Fatal("Error occured while initialising miner", "error", err) } defer stack.Close() @@ -160,7 +160,7 @@ func TestValidatorWentOffline(t *testing.T) { time.Sleep(3 * time.Second) for _, node := range nodes { if err := node.StartMining(1); err != nil { - panic(err) + t.Fatal("Error occured while starting miner", "node", node, "error", err) } } @@ -198,11 +198,11 @@ func TestValidatorWentOffline(t *testing.T) { blockHeaderVal1 := nodes[1].BlockChain().GetHeaderByNumber(10) authorVal0, err := nodes[0].Engine().Author(blockHeaderVal0) if err != nil { - log.Error("Error in getting author", "err", err) + t.Error("Error in getting author", "err", err) } authorVal1, err := nodes[1].Engine().Author(blockHeaderVal1) if err != nil { - log.Error("Error in getting author", "err", err) + t.Error("Error in getting author", "err", err) } // check both nodes have the same block 10 @@ -219,11 +219,11 @@ func TestValidatorWentOffline(t *testing.T) { blockHeaderVal1 = nodes[1].BlockChain().GetHeaderByNumber(11) authorVal0, err = nodes[0].Engine().Author(blockHeaderVal0) if err != nil { - log.Error("Error in getting author", "err", err) + t.Error("Error in getting author", "err", err) } authorVal1, err = nodes[1].Engine().Author(blockHeaderVal1) if err != nil { - log.Error("Error in getting author", "err", err) + t.Error("Error in getting author", "err", err) } // check both nodes have the same block 11 @@ -240,11 +240,11 @@ func TestValidatorWentOffline(t *testing.T) { blockHeaderVal1 = nodes[1].BlockChain().GetHeaderByNumber(12) authorVal0, err = nodes[0].Engine().Author(blockHeaderVal0) if err != nil { - log.Error("Error in getting author", "err", err) + t.Error("Error in getting author", "err", err) } authorVal1, err = nodes[1].Engine().Author(blockHeaderVal1) if err != nil { - log.Error("Error in getting author", "err", err) + t.Error("Error in getting author", "err", err) } // check both nodes have the same block 12 @@ -261,11 +261,11 @@ func TestValidatorWentOffline(t *testing.T) { blockHeaderVal1 = nodes[1].BlockChain().GetHeaderByNumber(17) authorVal0, err = nodes[0].Engine().Author(blockHeaderVal0) if err != nil { - log.Error("Error in getting author", "err", err) + t.Error("Error in getting author", "err", err) } authorVal1, err = nodes[1].Engine().Author(blockHeaderVal1) if err != nil { - log.Error("Error in getting author", "err", err) + t.Error("Error in getting author", "err", err) } // check both nodes have the same block 17 @@ -348,7 +348,7 @@ func TestForkWithBlockTime(t *testing.T) { // Start the node and wait until it's up stack, ethBackend, err := initMiner(genesis, keys[i]) if err != nil { - panic(err) + t.Fatal("Error occured while initialising miner", "error", err) } defer stack.Close() @@ -369,7 +369,7 @@ func TestForkWithBlockTime(t *testing.T) { time.Sleep(3 * time.Second) for _, node := range nodes { if err := node.StartMining(1); err != nil { - panic(err) + t.Fatal("Error occured while starting miner", "node", node, "error", err) } } @@ -400,22 +400,22 @@ func TestForkWithBlockTime(t *testing.T) { author0, err := nodes[0].Engine().Author(blockHeaderVal0) if err != nil { - log.Error("Error occured while fetching author", "err", err) + t.Error("Error occured while fetching author", "err", err) } author1, err := nodes[1].Engine().Author(blockHeaderVal1) if err != nil { - log.Error("Error occured while fetching author", "err", err) + t.Error("Error occured while fetching author", "err", err) } assert.Equal(t, author0, author1) // After the end of sprint author2, err := nodes[0].Engine().Author(blockHeaders[0]) if err != nil { - log.Error("Error occured while fetching author", "err", err) + t.Error("Error occured while fetching author", "err", err) } author3, err := nodes[1].Engine().Author(blockHeaders[1]) if err != nil { - log.Error("Error occured while fetching author", "err", err) + t.Error("Error occured while fetching author", "err", err) } if test.forkExpected {