-
Notifications
You must be signed in to change notification settings - Fork 241
Add warning to the group API about asynchronize code #1011
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
Conversation
src/data/markdown/docs/02 javascript api/02 k6/group- name- fn -.md
Outdated
Show resolved
Hide resolved
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.
Just made some suggestions for smoother flow and shorter sentences.
I tried to get to a verb as quickly as possible in each sentence, because a long subject like
Using group with async functions or any kind of asynchronize code
creates a lot of information that the reader must hold in their head before getting to the verb,
does not work.
src/data/markdown/docs/02 javascript api/02 k6/group- name- fn -.md
Outdated
Show resolved
Hide resolved
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.
@mstoykov Please merge when ready. I'm not sure about when this will come out.
… -.md Co-authored-by: Matt Dodson <47385188+MattDodsonEnglish@users.noreply.github.com>
2928615
to
35bd8fa
Compare
force pushed to fix the after merging with rebase the branch this was based on. Also hopefully we will get a preview 🤞 |
src/data/markdown/docs/02 javascript api/02 k6/group- name- fn -.md
Outdated
Show resolved
Hide resolved
<Blockquote mod="warning"> | ||
|
||
Avoid using `group` with async functions or asynchronous code. | ||
If you do, k6 might apply tags in a way that is unreliable or unintuitive. |
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.
<Blockquote mod="warning"> | |
Avoid using `group` with async functions or asynchronous code. | |
If you do, k6 might apply tags in a way that is unreliable or unintuitive. | |
<Blockquote mod="warning" title="Avoid using group with async operations"> | |
This might cause k6 to apply tags in a way that is unreliable or unintuitive. |
… -.md Co-authored-by: na-- <n@andreev.sh>
| ---- | ------------------------- | | ||
| any | The return value of _fn_. | | ||
|
||
<Blockquote mod="warning" title="Working with async functions"> |
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.
<Blockquote mod="warning" title="Working with async functions"> | |
<Blockquote mod="attention" title="Working with async functions"> |
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.
I didn't realize that we need to downgrade the admonition. This is more of a "proceed carefully", not "you will do irreparable harm".
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.
To be honest using async and group works so strange (given the input from other k6 OSS contributors), even with changes that are not landing, that it is more or less "if you do this we do not give you any gurantees how it will work". Which kind of borders on "if it will work"
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.
But, to quote the style guidelines:
Stronger than a caution notice; it means "Don't do this" or that this step might be irreversible, such as leading to permanent data loss. If a reader doesn't heed the warning, they can lose money, lose work, or open themselves to a security breach. For example, "Don't put a password on the command line; doing so is a security risk."
I mean, if async is this bad in groups, is it possible to just forbid completely?
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.
we do that to the extend that is possible and then this is here to both note that this is the case, link to the issue that explains this in more details and tell people to not even try to circument this as it will likely not work as they think it will.
No description provided.