From 440841d565868566f80e7b38ce82a3b982eb85e7 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Fri, 8 Dec 2023 23:14:01 +0800 Subject: [PATCH] only run it in the middle of an epoch (#13303) --- testing/endtoend/endtoend_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testing/endtoend/endtoend_test.go b/testing/endtoend/endtoend_test.go index c9ccbf7be..fcdec3441 100644 --- a/testing/endtoend/endtoend_test.go +++ b/testing/endtoend/endtoend_test.go @@ -380,6 +380,10 @@ func (r *testRunner) testBeaconChainSync(ctx context.Context, g *errgroup.Group, // Sleep a slot to make sure the synced state is made. time.Sleep(time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second) syncEvaluators := []e2etypes.Evaluator{ev.FinishedSyncing, ev.AllNodesHaveSameHead} + // Only execute in the middle of an epoch to prevent race conditions around slot 0. + ticker := helpers.NewEpochTicker(tickingStartTime, secondsPerEpoch) + <-ticker.C() + ticker.Done() for _, evaluator := range syncEvaluators { t.Run(evaluator.Name, func(t *testing.T) { assert.NoError(t, evaluator.Evaluation(nil, conns...), "Evaluation failed for sync node")