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

setup/teardownTimeout behavior when set to 0s #1174

Closed
cuonglm opened this issue Sep 24, 2019 · 9 comments
Closed

setup/teardownTimeout behavior when set to 0s #1174

cuonglm opened this issue Sep 24, 2019 · 9 comments
Assignees
Labels
enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature good first issue

Comments

@cuonglm
Copy link
Contributor

cuonglm commented Sep 24, 2019

Currently, setup/teaddownTimeout duration if set to 0s means we can't run setup/teardown functions anymore. With script:

import http from 'k6/http';
import { k6 } from 'k6';

export function setup() {
  sleep(1);
}

export default function() {
  const response = http.get("http://test.loadimpact.com");
};

Run:

$ K6_SETUP_TIMEOUT=0s k6 run t.js

          /\      |‾‾|  /‾‾/  /‾/
     /\  /  \     |  |_/  /  / /
    /  \/    \    |      |  /  ‾‾\
   /          \   |  |‾\  \ | (_) |
  / __________ \  |__|  \__\ \___/ .io

  execution: local
     output: -
     script: t.js

    duration: -,  iterations: 1
         vus: 1, max: 1

ERRO[0000] Setup timeout                                 error="setup: Timeout during setup"
ERRO[0000] Setup timeout
exit 100

In most libraries, setting timeout duration to 0 often means disable the timeout. Should we adopt that behavior to k6 as well?

@cuonglm cuonglm added enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature labels Sep 24, 2019
@cuonglm
Copy link
Contributor Author

cuonglm commented Sep 25, 2019

We do have minIterationDuration which will be disable when set to 0.

@imiric imiric changed the title setup/teaddownTimeout behavior when set to 0s setup/teardownTimeout behavior when set to 0s Oct 2, 2019
@JustJordanT
Copy link

JustJordanT commented Apr 15, 2024

Is this something that still needs to be worked on?

@mstoykov
Copy link
Contributor

Hu @JustJordanT - yes it appears nobody has worked on it and it still a problem.

@mstoykov mstoykov removed their assignment Apr 26, 2024
@mstoykov mstoykov removed the triage label Apr 26, 2024
@tsukasaI
Copy link
Contributor

Hi, can I take this one?

@tsukasaI
Copy link
Contributor

Hi, I opened PR.
I would appreciate your reply. Thank you!

@mstoykov
Copy link
Contributor

I don't think we should have a way to disable the timeout in more or less the same vein as #2701 - there is no need for that.

The current proposed PR disables the setup/teardown execution, but I am not particularly certain that is a good idea either. There already is an option for that, and I will expect that ... yes most people will expect this to mean it is infinite, and then it just doesn't run.

I am kind of for this just being a validation error similar to if you define it as negative number.

cc @grafana/k6-core

@tsukasaI
Copy link
Contributor

@mstoykov

Thank you for comment.

Oh Yeah, I would think we should have a validation for that this property is positive number.

Can I introduce the validation?

@tsukasaI
Copy link
Contributor

Hi @mstoykov
I updated my PR. #3898

I would appreciate your review. Thank you!

@oleiade oleiade removed the triage label Sep 2, 2024
@mstoykov
Copy link
Contributor

mstoykov commented Oct 3, 2024

This was fixed with #3898 thanks to @tsukasaI 🙇

@mstoykov mstoykov closed this as completed Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature good first issue
Projects
None yet
Development

No branches or pull requests

5 participants