Skip to content

Commit

Permalink
fix: smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
istae committed Oct 10, 2023
1 parent 5eead45 commit 573453e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/check/smoke/smoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int
txData []byte
rxData []byte
address swarm.Address
batchID string
uploaded bool
)

txData = make([]byte, o.ContentSize)
Expand All @@ -136,6 +138,8 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int
for retries := 0; retries < 3; retries++ {
txCancel()

uploaded = false

select {
case <-ctx.Done():
return nil
Expand All @@ -146,7 +150,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int

c.metrics.BatchCreateAttempts.Inc()

batchID, err := clients[txName].GetOrCreateBatch(txCtx, o.PostageAmount, o.PostageDepth, "load-test")
batchID, err = clients[txName].GetOrCreateBatch(txCtx, o.PostageAmount, o.PostageDepth, "load-test")
if err != nil {
c.logger.Errorf("create new batch: %v", err)
c.metrics.BatchCreateErrors.Inc()
Expand All @@ -160,13 +164,13 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int
c.logger.Infof("upload failed: %v", err)
c.logger.Infof("retrying in: %v", o.TxOnErrWait)
} else {
uploaded = true
break
}
}
txCancel()

if err != nil {
continue // skip
if !uploaded {
continue
}

c.metrics.UploadDuration.Observe(txDuration.Seconds())
Expand Down

0 comments on commit 573453e

Please sign in to comment.