-
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
Propagate the real context when initializing VUs #2790
Comments
This was referenced Dec 2, 2022
This was referenced Feb 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, VU initialization doesn't receive a context. The last time we propagate the context is here:
k6/core/local/local.go
Lines 172 to 173 in 564197a
But then we don't pass it to the layers below:
k6/core/local/local.go
Line 182 in 564197a
k6/core/local/local.go
Line 143 in 564197a
k6/js/runner.go
Lines 115 to 126 in 564197a
k6/js/bundle.go
Lines 242 to 247 in 564197a
And, at the end, we end up using
context.Background()
😞k6/js/bundle.go
Line 329 in 564197a
This is not ideal because we don't have any way of aborting the VU initialization if the user hits Ctrl+C or if one of the VUs fails during the concurrent VU initialization and we need to abort the initialization of the rest of the VUs and wait for that to finish quickly (see here and here).
Currently, we just rely on the fact that we'll use
os.Exit()
to stop k6, however that assumption breaks in a few cases:--linger
option is used, we might want to have the k6 process linger even if there was an init error, same as we'd do if the test was aborted by threshold orexecution.test.abort()
In general, the current behavior breaks the very reasonable expectation that once the
k6 run
command has finished and returned, all of its child goroutines have also finished and returned before it...The text was updated successfully, but these errors were encountered: