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: continue_next should be true by default #4

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func doRequest(config *LoaderConfig, globalCtx util.MapStr, req *fasthttp.Reques
}
condition, buildErr := conditions.NewCondition(item.Assert)
if buildErr != nil {
log.Errorf("failed to build conditions whilte assert existed, error: %+v", buildErr)
log.Errorf("failed to build conditions while assert existed, error: %+v", buildErr)
loadStats.NumInvalid++
return
}
Expand All @@ -233,6 +233,7 @@ func doRequest(config *LoaderConfig, globalCtx util.MapStr, req *fasthttp.Reques
}

if !config.RunnerConfig.ContinueOnAssertInvalid {
log.Infof("assertion failed, skipping subsequent requests,", item.Assert, ", event:", event)
return false, err
}
}
Expand All @@ -245,7 +246,7 @@ func doRequest(config *LoaderConfig, globalCtx util.MapStr, req *fasthttp.Reques
}
}

return
return true, nil
}

func buildCtx(resp *fasthttp.Response, respBody []byte, duration time.Duration) util.MapStr {
Expand Down Expand Up @@ -298,7 +299,7 @@ func (cfg *LoadGenerator) Run(config *LoaderConfig, countLimit int, timer *tachy
}
totalRounds += 1

for _, item := range config.Requests {
for i, item := range config.Requests {

if !config.RunnerConfig.BenchmarkOnly {
if countLimit > 0 && totalRequests >= countLimit {
Expand All @@ -317,7 +318,10 @@ func (cfg *LoadGenerator) Run(config *LoaderConfig, countLimit int, timer *tachy

item.prepareRequest(config, globalCtx, req)

next, _ := doRequest(config, globalCtx, req, resp, &item, loadStats, timer)
next, err := doRequest(config, globalCtx, req, resp, &item, loadStats, timer)
if global.Env().IsDebug {
log.Debugf("#%v,contine: %v, err:%v", i, next, err)
}
if !next {
break
}
Expand Down
Loading