Skip to content

Commit d95ca2e

Browse files
authored
cmd/devp2p/internal/ethtest: fix possible infinite wait (#32551)
TestBlobTxWithoutSidecar test could run infinitely in case of a client not requesting the good transaction. This adds a timeout to make the test fail in this case. Fixes #32422 Signed-off-by: Csaba Kiraly <[email protected]>
1 parent bc4ee71 commit d95ca2e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/devp2p/internal/ethtest/suite.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,10 @@ func (s *Suite) testBadBlobTx(t *utesting.T, tx *types.Transaction, badTx *types
11331133
// transmit the same tx but with correct sidecar from the good peer.
11341134

11351135
var req *eth.GetPooledTransactionsPacket
1136-
req, err = readUntil[eth.GetPooledTransactionsPacket](context.Background(), conn)
1136+
ctx, cancel := context.WithTimeout(context.Background(), 12*time.Second)
1137+
defer cancel()
1138+
1139+
req, err = readUntil[eth.GetPooledTransactionsPacket](ctx, conn)
11371140
if err != nil {
11381141
errc <- fmt.Errorf("reading pooled tx request failed: %v", err)
11391142
return

0 commit comments

Comments
 (0)