-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Wait for metrics handling to finish even when there is an error #2798
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍🏻
cea7276
138246a
to
cea7276
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice job with the tests 👍
CI didn't run for some reason after your latest push 😕
Previous to this, setup() and teardown() exceptions or test.abort() calls would have made k6 exit prematurely, without waiting for the metrics processing to finish. This also caused a data race in integration tests and undefined behavior in general. The handleSummary() function was also called only when test.abort() was used, but not when there was an error in `setup()` and `teardown()`. The commit also adds and improves a bunch of integration tests, particularly when it comes to validating aborted tests and --linger.
cea7276
to
a8ff4a1
Compare
Weird 😕 force-pushed again, with no changes besides the commit message, and CI seems to have started fine this time 🤞 |
Before these changes,
setup()
andteardown()
exceptions ortest.abort()
calls would have made k6 exit prematurely, without waiting for the metrics processing to finish. This bug was probably a cause for some of the "timed out"k6 run --out cloud
tests we have seen, e.g. if they had some sort an error insetup()
orteardown()
. It also caused a data race in the recent integration tests, this is how I caught it. So, as a nice bonus, this fix allowed me to remove one of theFIXME
s for unnecessary locking in there earlier than expected 🎉This is another thing that should be fixed by the new
Engine
-less architecture (#1889). However, once again, the fix was easy enough to do even now, and the bug severe enough that it's probably worth it to include it in the upcoming k6 v0.42.0.I also added and expanded a bunch of integration tests, particularly when it comes to validating aborted tests and
--linger
, and this PR is built on top of #2795, so hopefully its last minute merging won't cause any regressions 🤞 🙏 📿 .It seemed like the bug might have been introduced in k6 v0.36.0, via #2093 (the PR that added
test.abort()
), but it was actually probably introduced way back in k6 v0.27.0, with #1390, or even older... 😞 Still, the added tests fortest.abort()
and setup/teardown exceptions should provide some assurance now and in the future.