cmd/devp2p/internal/ethtest: fix possible infinite wait

TestBlobTxWithoutSidecar test could run infinately in case of
a client not requesting the good transaction. This adds a timeout
to make the test fail in this case.

Fixes https://github.com/ethereum/go-ethereum/issues/32422

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2025-09-08 12:28:01 +02:00
parent 25cce4dfe4
commit f1bb2c2d6f
No known key found for this signature in database
GPG key ID: 0FE274EE8C95166E

View file

@ -1133,7 +1133,10 @@ func (s *Suite) testBadBlobTx(t *utesting.T, tx *types.Transaction, badTx *types
// transmit the same tx but with correct sidecar from the good peer.
var req *eth.GetPooledTransactionsPacket
req, err = readUntil[eth.GetPooledTransactionsPacket](context.Background(), conn)
ctx, cancel := context.WithTimeout(context.Background(), 12*time.Second)
defer cancel()
req, err = readUntil[eth.GetPooledTransactionsPacket](ctx, conn)
if err != nil {
errc <- fmt.Errorf("reading pooled tx request failed: %v", err)
return