From 4f0d8f0d15f06c70865cbfe1c993753ada979940 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi <1591639+s1na@users.noreply.github.com> Date: Thu, 13 Jul 2023 12:41:58 +0200 Subject: [PATCH] graphql: fix race in withdrawals test (#27706) graphql: fix race in test --- graphql/graphql_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/graphql/graphql_test.go b/graphql/graphql_test.go index 22d7181b0d..4bbfb7251d 100644 --- a/graphql/graphql_test.go +++ b/graphql/graphql_test.go @@ -445,19 +445,21 @@ func newGQLService(t *testing.T, stack *node.Node, shanghai bool, gspec *core.Ge TrieTimeout: 60 * time.Minute, SnapshotCache: 5, } - ethBackend, err := eth.New(stack, ethConf) - if err != nil { - t.Fatalf("could not create eth backend: %v", err) - } var engine consensus.Engine = ethash.NewFaker() if shanghai { engine = beacon.NewFaker() chainCfg := gspec.Config chainCfg.TerminalTotalDifficultyPassed = true chainCfg.TerminalTotalDifficulty = common.Big0 - shanghaiTime := uint64(0) + // GenerateChain will increment timestamps by 10. + // Shanghai upgrade at block 1. + shanghaiTime := uint64(5) chainCfg.ShanghaiTime = &shanghaiTime } + ethBackend, err := eth.New(stack, ethConf) + if err != nil { + t.Fatalf("could not create eth backend: %v", err) + } // Create some blocks and import them chain, _ := core.GenerateChain(params.AllEthashProtocolChanges, ethBackend.BlockChain().Genesis(), engine, ethBackend.ChainDb(), genBlocks, genfunc)