Skip to content

Commit 9c35de0

Browse files
committed
fix: k6runner/http: increase number of attempts recorded in metric
I've been writing code for 16 years at the time of this commit point but apparently I'm still capable of forgetting to increment a counter in a loop.
1 parent 371f16e commit 9c35de0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/k6runner/http.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,13 @@ func (r HttpRunner) Run(ctx context.Context, script Script, secretStore SecretSt
8686
}
8787

8888
// Retry logic is purely context (time) based, but we keep track of the number of attempts for reporting telemetry.
89-
attempts := 1.0
9089
wait := r.backoff
90+
var attempts float64
9191
var response *RunResponse
9292
for {
9393
start := time.Now()
9494

95+
attempts += 1
9596
var err error
9697
response, err = r.request(ctx, script, secretStore)
9798
if err == nil {

0 commit comments

Comments
 (0)