mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
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 https://github.com/ethereum/go-ethereum/issues/32422 Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
bc4ee71a5d
commit
d95ca2e056
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue