Skip to content

Commit

Permalink
fix: tx client concurrency test
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters committed Dec 10, 2024
1 parent f11a169 commit c911c8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/user/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -61,7 +61,6 @@ func TestConcurrentTxSubmission(t *testing.T) {
}(blobs[i])
}
wg.Wait()

select {
case err := <-errCh:
require.NoError(t, err)
Expand Down
3 changes: 3 additions & 0 deletions pkg/user/tx_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit c911c8f

Please sign in to comment.