Skip to content
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

Fix multiple bugs in the HTTP request and batch handling #642

Merged
merged 3 commits into from
May 23, 2018
Merged

Conversation

na--
Copy link
Member

@na-- na-- commented May 23, 2018

Included changes:

  • Fix Unable to send raw binary file. #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 Specifying "Options" before "Post" causes runtime error in script #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 a bug where some system tags could be overwritten by user-supplied tags from the script.
  • Hopefully slightly ameliorate the situation with Refactor HTTP.request() method #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...

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...
@codecov-io
Copy link

codecov-io commented May 23, 2018

Codecov Report

Merging #642 into master will decrease coverage by 0.05%.
The diff coverage is 76.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #642      +/-   ##
==========================================
- Coverage   64.54%   64.48%   -0.06%     
==========================================
  Files         101      101              
  Lines        8060     8107      +47     
==========================================
+ Hits         5202     5228      +26     
- Misses       2529     2542      +13     
- Partials      329      337       +8
Impacted Files Coverage Δ
cmd/root.go 30.76% <ø> (ø) ⬆️
js/modules/k6/http/http.go 77.35% <ø> (ø) ⬆️
js/modules/k6/ws/ws.go 72.54% <100%> (+0.4%) ⬆️
js/modules/k6/http/http_request.go 80.18% <75.95%> (-3.02%) ⬇️
js/modules/k6/http/http_url.go 90.47% <81.81%> (-9.53%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a973a6a...cd96bfa. Read the comment docs.

Copy link
Member

@robingustafsson robingustafsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@luizbafilho luizbafilho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@na-- na-- merged commit 0c67ec9 into master May 23, 2018
@na-- na-- deleted the http-fixes branch May 23, 2018 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to send raw binary file. Specifying "Options" before "Post" causes runtime error in script
4 participants