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

disable lab before timeout #652

Closed
danielo515 opened this issue Oct 21, 2016 · 6 comments
Assignees
Labels
bug
Milestone

Comments

@danielo515
Copy link

@danielo515 danielo515 commented Oct 21, 2016

According to the documentation, lab.before accepts an option object with arguments, one of them can be timeout

timeout - set a specific timeout in milliseconds. Disabled by default or the value of -M.

According to documentation it is disabled by default, but if I do not set certain timeout it is failing after 2k milliseconds. I tried to set it to 0 with the same result. Could someone teach me a valid way?

Thanks and regards

@geek geek added the bug label Oct 21, 2016
@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Oct 21, 2016

It looks like a bug where 0 isn't allowed: https://github.com/hapijs/lab/blob/master/lib/runner.js#L338

I will fix this later tonight, or if you want to submit a PR, I am happy to merge and publish.

@kgraves

This comment has been minimized.

Copy link
Contributor

@kgraves kgraves commented Oct 26, 2016

I'm happy to submit a PR for this, if you guys haven't already done the work. However, I have a couple questions:

  • On the above quote of the documentation, I'm confused as to what the - in -M represents.
  • What, if any, constraints do we put on timeout? (i.e. positive number, integer, etc)
@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Oct 26, 2016

@kgraves
-M represents the command argument for the timeout for each test
It needs to be anything that setTimeout will accept

geek added a commit that referenced this issue Oct 28, 2016
* fixes logic for lab.before timeout

* adds unit test for lab.before timeout logic
@danielo515

This comment has been minimized.

Copy link
Author

@danielo515 danielo515 commented Mar 15, 2017

I think this issue can be closed

@geek geek closed this Mar 15, 2017
@geek geek self-assigned this Mar 15, 2017
@geek geek added this to the 11.2.0 milestone Mar 15, 2017
@danielo515

This comment has been minimized.

Copy link
Author

@danielo515 danielo515 commented Mar 28, 2017

Sorry for issue respawn, but The documentation is still wrong about this feature.

What documentation says.

Timeout - set a specific timeout in milliseconds. Disabled by default or the value of -M.

But my experience demonstrates that it is not Disabled by default, if you do not provide a value, and relies to the default behavior it fails after 2k milliseconds. I suggest to update the documentation or to update the code to match the documentation.

@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Mar 28, 2017

@danielo515 please open a PR to fix the docs, I'll merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.