-
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
HTTP requests in the init context #284
Comments
@rafaelcapucho HTTP calls aren't allowed in the "init" stage of k6 (in the global scope). This should be clarified in the docs, so thanks for bringing it to our attention. All it says now regarding the "init" vs "VU" code is here: https://docs.k6.io/docs/running-k6#section-adding-more-vus I believe your use case would be solved by #194. Until that is implemented I'd suggest a workaround like:
The |
Something you can do as well is to There should also be a more sensible error message than that; adding an issue for this. |
This was also closed by #811 |
Hi, I noted that I'm unable to call functions outside of the
export default function
, as the following example:I left two comments pointing the function calls.
The error that it produces when I call it outside of
default function
is like:I'd like to execute it from outside because it must execute only once, the tests itself will use it later on.
Thanks!
The text was updated successfully, but these errors were encountered: