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

When using `stages`, the first request fails "net/http: request canceled while waiting for connection" #326

Closed
ppcano opened this Issue Sep 29, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@ppcano
Member

ppcano commented Sep 29, 2017

The test:

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

export let options = {
  stages: [{duration: "10s", target: 10}]
};

export default function() {
  http.get('https://loadimpact.com/');

  sleep(1.0)
};

Output:

{"type":"Metric","data":{"name":"http_reqs","type":"counter","contains":"default","tainted":null,"thresholds":[],"submetrics":null},"metric":"http_reqs"}
{"type":"Point","data":{"time":"2017-09-29T16:04:39.887037221+02:00","value":1,"tags":{"error":"Get https://loadimpact.com/: net/http: request canceled while waiting for connection","group":"","method":"GET","name":"https://loadimpact.com/","proto":"","status":"0","url":"https://loadimpact.com/"}},"metric":"http_reqs"}
{"type":"Metric","data":{"name":"http_req_duration","type":"trend","contains":"time","tainted":null,"thresholds":[],"submetrics":null},"metric":"http_req_duration"}
{"type":"Point","data":{"time":"2017-09-29T16:04:39.887037221+02:00","value":0,"tags":{"error":"Get https://loadimpact.com/: net/http: request canceled while waiting for connection","group":"","method":"GET","name":"https://loadimpact.com/","proto":"","status":"0","url":"https://loadimpact.com/"}},"metric":"http_req_duration"}
{"type":"Metric","data":{"name":"http_req_blocked","type":"trend","contains":"time","tainted":null,"thresholds":[],"submetrics":null},"metric":"http_req_blocked"}
{"type":"Point","data":{"time":"2017-09-29T16:04:39.887037221+02:00","value":0,"tags":{"error":"Get https://loadimpact.com/: net/http: request canceled while waiting for connection","group":"","method":"GET","name":"https://loadimpact.com/","proto":"","status":"0","url":"https://loadimpact.com/"}},"metric":"http_req_blocked"}
{"type":"Metric","data":{"name":"http_req_connecting","type":"trend","contains":"time","tainted":null,"thresholds":[],"submetrics":null},"metric":"http_req_connecting"}
{"type":"Point","data":{"time":"2017-09-29T16:04:39.887037221+02:00","value":0,"tags":{"error":"Get https://loadimpact.com/: net/http: request canceled while waiting for connection","group":"","method":"GET","name":"https://loadimpact.com/","proto":"","status":"0","url":"https://loadimpact.com/"}},"metric":"http_req_connecting"}
{"type":"Metric","data":{"name":"http_req_sending","type":"trend","contains":"time","tainted":null,"thresholds":[],"submetrics":null},"metric":"http_req_sending"}
{"type":"Point","data":{"time":"2017-09-29T16:04:39.887037221+02:00","value":0,"tags":{"error":"Get https://loadimpact.com/: net/http: request canceled while waiting for connection","group":"","method":"GET","name":"https://loadimpact.com/","proto":"","status":"0","url":"https://loadimpact.com/"}},"metric":"http_req_sending"}
{"type":"Metric","data":{"name":"http_req_waiting","type":"trend","contains":"time","tainted":null,"thresholds":[],"submetrics":null},"metric":"http_req_waiting"}
{"type":"Point","data":{"time":"2017-09-29T16:04:39.887037221+02:00","value":0,"tags":{"error":"Get https://loadimpact.com/: net/http: request canceled while waiting for connection","group":"","method":"GET","name":"https://loadimpact.com/","proto":"","status":"0","url":"https://loadimpact.com/"}},"metric":"http_req_waiting"}
{"type":"Metric","data":{"name":"http_req_receiving","type":"trend","contains":"time","tainted":null,"thresholds":[],"submetrics":null},"metric":"http_req_receiving"}
{"type":"Point","data":{"time":"2017-09-29T16:04:39.887037221+02:00","value":0,"tags":{"error":"Get https://loadimpact.com/: net/http: request canceled while waiting for connection","group":"","method":"GET","name":"https://loadimpact.com/","proto":"","status":"0","url":"https://loadimpact.com/"}},"metric":"http_req_receiving"}

It works well when using vus and duration.

export let options = {
  vus: 10, duration: "10s"
};
@liclac

This comment has been minimized.

Show comment
Hide comment
@liclac

liclac Nov 15, 2017

Collaborator

This was actually indicative of something much bigger - tests would start out with 1 VU, then immediately scale down to 0 because the stage interpolation code didn't consider the starting point of the first stage

Collaborator

liclac commented Nov 15, 2017

This was actually indicative of something much bigger - tests would start out with 1 VU, then immediately scale down to 0 because the stage interpolation code didn't consider the starting point of the first stage

@ppcano

This comment has been minimized.

Show comment
Hide comment
@ppcano

ppcano Nov 16, 2017

Member

@liclac 👏 👏

Member

ppcano commented Nov 16, 2017

@liclac 👏 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment