Skip to content

Commit

Permalink
Refine flaky test with undetermined amount of iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
joanlopez committed Feb 7, 2025
1 parent 7a057b6 commit 75af9ab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion internal/cmd/runtime_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ func saveBoolFromEnv(env map[string]string, varName string, placeholder *null.Bo
return nil
}

func getRuntimeOptions(flags *pflag.FlagSet, environment map[string]string) (lib.RuntimeOptions, error) { //nolint:funlen
func getRuntimeOptions(
flags *pflag.FlagSet,
environment map[string]string,
) (lib.RuntimeOptions, error) { //nolint:funlen

Check failure on line 65 in internal/cmd/runtime_options.go

View workflow job for this annotation

GitHub Actions / lint

directive `//nolint:funlen` is unused for linter "funlen" (nolintlint)
// TODO: refactor with composable helpers as a part of #883, to reduce copy-paste
// TODO: get these options out of the JSON config file as well?
opts := lib.RuntimeOptions{
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/tests/cmd_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ func TestAbortedByThreshold(t *testing.T) {
assert.True(t, testutils.LogContains(ts.LoggerHook.Drain(), logrus.ErrorLevel, expErr))
stdOut := ts.Stdout.String()
t.Log(stdOut)
assert.Contains(t, stdOut, "iterations\n ✗ 'count == 1' count=2")
assert.Contains(t, stdOut, "iterations\n ✗ 'count == 1'")
assert.Contains(t, stdOut, `teardown() called`)
assert.Contains(t, stdOut, `level=debug msg="Metrics emission of VUs and VUsMax metrics stopped"`)
assert.Contains(t, stdOut, `level=debug msg="Metrics and traces processing finished!"`)
Expand Down
4 changes: 3 additions & 1 deletion output/summary/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func New(params output.Params) (*Output, error) {
}, nil
}

// OutputName is the name of the output.
const OutputName = "summary"

// Description returns a human-readable description of the output.
Expand Down Expand Up @@ -114,7 +115,8 @@ func (o *Output) flushSample(sample metrics.Sample) {
func (o *Output) Summary(
executionState *lib.ExecutionState,
observedMetrics map[string]*metrics.Metric,
options lib.Options) *lib.Summary {
options lib.Options,
) *lib.Summary {
testRunDuration := executionState.GetCurrentTestRunDuration()

summary := lib.NewSummary()
Expand Down

0 comments on commit 75af9ab

Please sign in to comment.