diff --git a/e2e_test/e2e_test.go b/e2e_test/e2e_test.go index d219182a37..0fb57c4aa6 100644 --- a/e2e_test/e2e_test.go +++ b/e2e_test/e2e_test.go @@ -379,15 +379,24 @@ func runStopNetworkAtL2BlockTest(ctx context.Context, t *testing.T, network test // fail if any node adds a new block >= the migration block var wg sync.WaitGroup + errorChan := make(chan error, len(network)) + for _, n := range network { wg.Add(1) go func(n *test.Node) { defer wg.Done() err := n.Tracker.AwaitBlock(shortCtx, l2Block.Uint64()) - require.EqualError(t, err, context.DeadlineExceeded.Error()) + errorChan <- err }(n) } + wg.Wait() + close(errorChan) + + // Collect and check errors + for err := range errorChan { + require.EqualError(t, err, context.DeadlineExceeded.Error()) + } } func TestStopNetworkAtL2BlockSimple(t *testing.T) {