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

Split Scheduler.Run() into Init() and Run() again #2893

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

na--
Copy link
Member

@na-- na-- commented Feb 2, 2023

This reverts a big part of #2885 because, with all of the logic in Run(), k6 didn't know if it needed to wait when --linger was specified.

In general, if a script error or test.abort() occurs during init, --linger should not apply and k6 should exit immediately. But if test.abort() is called during the test run itself, or the test was stopped in some other way besides Ctrl+C (e.g. REST API, thresholds with abortOnFail), --linger means that k6 should not exit immediately after stopping the test.

This PR is on top of #2815, which we should later merge in master. #2804 is a somewhat related issue, where I'll also document this somewhat hidden and implicit requirements.

This reverts a big part of #2885 because with all of the logic in Run(), k6 didn't know if it needed to wait when --linger was specified.

In general, if a script error or test.abort() occurs during init, --linger should not apply and k6 should exit immediately. But if test.abort() is called during the test run itself, or the test was stopped in some other way besides Ctrl+C, --linger means that k6 should not exit immediately after stopping the test.
@codecov-commenter
Copy link

Codecov Report

Merging #2893 (94f88eb) into remove-the-engine (27b1a4d) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

@@                  Coverage Diff                  @@
##           remove-the-engine    #2893      +/-   ##
=====================================================
- Coverage              76.75%   76.67%   -0.08%     
=====================================================
  Files                    224      222       -2     
  Lines                  16835    16847      +12     
=====================================================
- Hits                   12921    12917       -4     
- Misses                  3080     3090      +10     
- Partials                 834      840       +6     
Flag Coverage Δ
ubuntu ?
windows 76.67% <100.00%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/run.go 71.08% <100.00%> (+0.47%) ⬆️
execution/scheduler.go 92.72% <100.00%> (-0.11%) ⬇️
lib/netext/tls.go 27.08% <0.00%> (-22.92%) ⬇️
loader/readsource.go 75.86% <0.00%> (-10.35%) ⬇️
lib/netext/httpext/transport.go 94.17% <0.00%> (-2.92%) ⬇️
lib/testutils/minirunner/minirunner.go 74.32% <0.00%> (-2.71%) ⬇️
cmd/ui.go 66.83% <0.00%> (-2.05%) ⬇️
lib/testutils/httpmultibin/httpmultibin.go 88.35% <0.00%> (-1.59%) ⬇️
lib/netext/httpext/request.go 92.68% <0.00%> (-0.61%) ⬇️
js/modules/k6/ws/ws.go 85.50% <0.00%> (-0.58%) ⬇️
... and 7 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@na-- na-- added this to the v0.43.0 milestone Feb 2, 2023
@na-- na-- merged commit 7660fe6 into remove-the-engine Feb 2, 2023
@na-- na-- deleted the re-split-scheduler-init-and-run branch February 2, 2023 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants