Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tx client concurrency test #4104

Merged
merged 8 commits into from
Jan 17, 2025
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
Loading