From c911c8f4b526421942766387e235d236480d8e4d Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 10 Dec 2024 11:58:21 +0100 Subject: [PATCH] fix: tx client concurrency test --- pkg/user/e2e_test.go | 5 ++--- pkg/user/tx_client.go | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/user/e2e_test.go b/pkg/user/e2e_test.go index e42710c22f..60c9a48814 100644 --- a/pkg/user/e2e_test.go +++ b/pkg/user/e2e_test.go @@ -33,13 +33,13 @@ func TestConcurrentTxSubmission(t *testing.T) { require.NoError(t, err) // Pregenerate all the blobs - numTxs := 10 + numTxs := 100 blobs := blobfactory.ManyRandBlobs(tmrand.NewRand(), blobfactory.Repeat(2048, numTxs)...) // Prepare transactions var ( wg sync.WaitGroup - errCh = make(chan error) + errCh = make(chan error, 1) ) subCtx, cancel := context.WithCancel(ctx.GoContext()) @@ -61,7 +61,6 @@ func TestConcurrentTxSubmission(t *testing.T) { }(blobs[i]) } wg.Wait() - select { case err := <-errCh: require.NoError(t, err) diff --git a/pkg/user/tx_client.go b/pkg/user/tx_client.go index ce2f7b8933..d4032b814a 100644 --- a/pkg/user/tx_client.go +++ b/pkg/user/tx_client.go @@ -463,6 +463,9 @@ func (client *TxClient) ConfirmTx(ctx context.Context, txHash string) (*TxRespon return nil, client.handleEvictions(txHash) default: client.deleteFromTxTracker(txHash) + if ctx.Err() != nil { + return nil, ctx.Err() + } return nil, fmt.Errorf("transaction with hash %s not found; it was likely rejected", txHash) } }