only run it in the middle of an epoch (#13303)

This commit is contained in:
Nishant Das 2023-12-08 23:14:01 +08:00 committed by GitHub
parent ff99616833
commit 440841d565
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")