-
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
Refactor HTTP.request() method #574
Comments
It may also be worth it to refactor some of the other functions with high cyclomatic complexity: https://goreportcard.com/report/github.com/loadimpact/k6#gocyclo |
Included changes: - Fix #626 - both the original bug with binary HTTP request bodies and the other bug described further down into the issue (incorrectly setting the body of a batch request). - Fix #598 - the batch data race was because functions in the goja runtime were called concurrently from the different goroutines spawned by the http.batch() call. The fix was to first sequentially parse all of the request options and then execute them concurrently. - Fix an error where some system tags could be overwritten by user-supplied tags from the script. - Hopefully slightly ameliorated the situation with #574. There's still a lot of work to be done there... Even though this commit somewhat separates the parsing and execution functions in the HTTP handling code, I don't think the code is much more readable and maintainable than before... I think that having a clear separation between the parsing and validation of JS invocations and the actual execution would help very much, but that would probably take a lot of time and effort to refactor...
Making a note here that we should probably handle the |
It's over 400 lines long... I think that this could be done in conjunction with #562 and/or something else that depends on modifications in
request()
.The text was updated successfully, but these errors were encountered: