Skip to content

Commit

Permalink
use channel to collect timeout errors awaiting post migration block
Browse files Browse the repository at this point in the history
  • Loading branch information
alecps committed Sep 16, 2024
1 parent 8a28788 commit c7bea32
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion e2e_test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c7bea32

Please sign in to comment.