From 82544382c1da6137bca30c43481806423e84a591 Mon Sep 17 00:00:00 2001 From: Oleg Kovalov Date: Thu, 6 Jun 2024 15:29:52 +0200 Subject: [PATCH] chore(swamp): remove always failing assert (#3463) 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 <41963722+renaynay@users.noreply.github.com> --- nodebuilder/tests/swamp/swamp.go | 1 - 1 file changed, 1 deletion(-) diff --git a/nodebuilder/tests/swamp/swamp.go b/nodebuilder/tests/swamp/swamp.go index 28dcfa5388..3578698622 100644 --- a/nodebuilder/tests/swamp/swamp.go +++ b/nodebuilder/tests/swamp/swamp.go @@ -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)