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

throw option not respected with malformed URLs #1502

Closed
na-- opened this issue Jun 12, 2020 · 0 comments · Fixed by #2045
Closed

throw option not respected with malformed URLs #1502

na-- opened this issue Jun 12, 2020 · 0 comments · Fixed by #2045

Comments

@na--
Copy link
Member

na-- commented Jun 12, 2020

This script demonstrates the issue:

import { sleep } from "k6";
import http from "k6/http";

export const options = {
    iterations: 10, // just to demonstrate how the sleep() is never reached
    //throw: true, // it's false by default, uncomment to test the different behavior
};

export default function () {
    // this will throw an exception if `throw` is true
    let r = http.get("https://some-wrong-domain.k6.io");
    console.log(r.error_code);

    // this will always throw an exception in the current k6
    r = http.get("https:// test.k6.io");

    // these will never be reached
    console.log(r.error_code);
    sleep(1);
}

And this somewhat connected issue should probably be fixed at the same time: #1199

@na-- na-- added this to the v0.28.0 milestone Jun 12, 2020
@na-- na-- modified the milestones: v0.28.0, v0.29.0 Sep 9, 2020
@na-- na-- modified the milestones: v0.29.0, v0.30.0 Nov 3, 2020
@na-- na-- modified the milestones: v0.30.0, v0.31.0 Jan 13, 2021
@na-- na-- modified the milestones: v0.31.0, v0.32.0 Mar 5, 2021
@na-- na-- modified the milestones: v0.32.0, v0.33.0 Apr 14, 2021
imiric pushed a commit that referenced this issue May 31, 2021
Closes #1502

Notes:
* Not sure if the verification should happen on Request()
* The way throw is disabled on the test feels clunky, it might be a better approach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant