Skip to content

Commit

Permalink
chore(swamp): remove always failing assert (celestiaorg#3463)
Browse files Browse the repository at this point in the history
From `context.Context.Err() error` documentation
(https://pkg.go.dev/context#Context):

```
	// If Done is not yet closed, Err returns nil.
	// If Done is closed, Err returns a non-nil error explaining why:
	// Canceled if the context was canceled
	// or DeadlineExceeded if the context's deadline passed.
	// After Err returns a non-nil error, successive calls to Err return the same error.
	Err() error
```

In other words when we observe a cancelled context `Err` is always not
nil https://go.dev/play/p/2N6F75a70lK

Co-authored-by: rene <[email protected]>
  • Loading branch information
cristaloleg and renaynay authored Jun 6, 2024
1 parent e2e2cac commit 8254438
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion nodebuilder/tests/swamp/swamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ func (s *Swamp) WaitTillHeight(ctx context.Context, height int64) libhead.Hash {
for {
select {
case <-ctx.Done():
require.NoError(s.t, ctx.Err())
case <-t.C:
latest, err := s.ClientContext.LatestHeight()
require.NoError(s.t, err)
Expand Down

0 comments on commit 8254438

Please sign in to comment.