-
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-debug shows incorrect "Accept-Encoding" #1042
Comments
Sorry for the frustration with this, unfortunately you are completely right again, this is a bug. Here's a demo script that confirms it: import http from "k6/http";
export default function () {
let resp = http.get("http://httpbin.org/anything")
console.log(resp.body)
} Running that script with k6 0.24.0 and the
But the
I still don't see what's causing the issue. We may have to open an upstream Golang bug report for this, since k6 is simply using the @kkeranen, where did you notice the |
I got Accept-Encoding: identity with Fiddler, but I was using k6 v0.22.1 in that test. I am assuming that k6 v0.24 behaves similarly, because the behavior is quite similar in both cases. I have v0.24 in Ubuntu and v0.22.1 in Windows 10, and got Fiddler more easily working with Windows 10. |
The reason for the issue seems to be that Go's This still seems like a Golang bug, but it's more a case of bad APIs, so I can't see a way for it to be fixed 😕... Potentially connected Go issue: golang/go#29607 (dead, unfortunately) |
And it's not even using the Anyway, I'm not sure what the best way for this to be fixed on the k6 side is 😕 The obvious solution is that we ditch Also, it seems to me that the current k6 architecture (where we dump the request before we send it) should also be changed. Besides the Instead, k6 should likely "inject" the HTTP request dumping in a manner closer to what you've done with Fiddler - by "listening" to the actual requests being sent and received. That could happen through something like the |
Well, I don't need to be fixed. It's enough that I know how it works. Therefore I suggest documenting this special feature so that others don't get confused and waste time investigating this. After all, k6 is performance testing tool and disabling/enabling compression is probably of great interest to k6 users. Maybe this header problem was made worse by incorrect reception timing because it seems to affect the duration timing, too. I make a more detailed comment into that issue. |
This makes the code slighly saner and fixes the bug where the first NTLM and digest authentication requests weren't displayed. But by no means does this fix all of the bugs in the http-debug code... For those, see: - #986 - #1042 - #774 A discussion how some or all of them can be fixed can be found here: #1102 (comment)
…#1102) Previously, there was an uncaught error (sometimes leading to panics) in the automatic response body decompression. This patch handles these decompression errors and even assigns a custom error code for them. As a bonus, k6 now also properly handles errors due to improper redirects, or too many redirects, and tags the resulting metric samples accordingly. By necessity, I had to also move the digest authentication and http-debug handling to their own http.RoundTripper layers. This by no means solves any of the following issues: - #800 - #986 - #1042 - #774 ...but it hopefully slightly improves the situation. For the digest authentication, a proper authentication cache, and very likely a different library, still have to be used... And regarding `http-debug`, a discussion about how some or all the remaining issues can be fixed can be found here: #1102 (comment)
aside: just making sure if I set |
@jberryman the stdlib will not set Please though use the community forum for pure questins to not muddle the issues ;) |
When not explicitly initializing Accept-Encoding field in HTTP request header, k6 or Go runtime implicitly adds Accept-Encoding: identity, which is fine. But not fine at all is that --http-debug option of k6 shows Accept-Encoding: gzip. I have wasted dozens of hours on this problem because I used to trust k6 debug info. A lot of this wasted time went just being able to get a proof by Fiddler, which I was finally able to get working with k6.
My related opening at community.k6.io.
Possibly related issue
The text was updated successfully, but these errors were encountered: