Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Mocha intermittent timeouts #955

Closed
mleanos opened this issue Oct 1, 2015 · 6 comments
Closed

Mocha intermittent timeouts #955

mleanos opened this issue Oct 1, 2015 · 6 comments
Assignees
Milestone

Comments

@mleanos
Copy link
Member

mleanos commented Oct 1, 2015

We seem to be having intermittent issues with the Mocha tests timing out; including the Travis CI builds failing due to these timeouts. This has been disrupting the flow of contributions with our PR's builds failing. Personally, when I've committed changes to a PR, I have been crossing my fingers that no tests timeout.

I suggest to implement suite level timeout increases; described here http://mochajs.org/#timeouts. This could be a permanent or temporary solution. Either way, it may save us a lot of headache when running through the CI builds.

I have a branch that I've been testing this with, and it seems to have solved the issue with timeouts. I'm setting the timeout using this.timeout(10000); for each server test suite (just once per file). It's a small change to each server test file.

I wanted to open the discussion before I submitted a PR. Perhaps there is a bigger issue at play here, rather than just latency issues. Any thoughts, or concerns over this approach?

@lirantal @ilanbiala @codydaig @rhutchison @trainerbill @simison @bastianwegge @jloveland

@codydaig
Copy link
Member

codydaig commented Oct 1, 2015

SGTM

@lirantal
Copy link
Member

lirantal commented Oct 1, 2015

Hi @mleanos,
As you can see, I've already used this timeout mechanism to address this issue here: https://github.com/meanjs/mean/blob/master/modules/users/tests/server/user.server.model.tests.js#L174

I'm ok with having a global one per the entire test suite as well.
I believe this is ok, and is just to address issues with CI building on environments where performance might not be the best like Travis.
You're welcome to send a PR for it.

@lirantal lirantal self-assigned this Oct 1, 2015
@lirantal lirantal added this to the 0.4.2 milestone Oct 1, 2015
@mleanos
Copy link
Member Author

mleanos commented Oct 1, 2015

@lirantal Ok great. Because I'm currently getting frustrated since I'm testing the tests atm :)

@bastianwegge
Copy link

Shouldn't this be about creating a sandbox for every test and making sure no requests or timeouts are running after every single test-suite finished rather than just increasing the timeout?

@mleanos
Copy link
Member Author

mleanos commented Oct 1, 2015

@bastianwegge Can provide an example, or proposed alternative solution?

I realize that my proposal may be just a temp solution. Right now, these timeouts are reaking havoc on the Travis builds, so it would be nice to get something out quickly.

@lirantal
Copy link
Member

lirantal commented Oct 1, 2015

"testing the tests" - that's nice :)

lirantal added a commit that referenced this issue Oct 3, 2015
kgrossnickle pushed a commit to cen3031-5a/trainerScheduling that referenced this issue Oct 10, 2017
Added a timeout of 10000 ms to each server test file. This is an attempt
to solve the timeout issues that we're experiencing with the Mocha
tests. Especially, this is hoping to address the build fails that are
caused by such timeouts.

Issue is described in meanjs/mean#955
lupinthethirdgentleman pushed a commit to lupinthethirdgentleman/mean-dashboard that referenced this issue Aug 5, 2021
Added a timeout of 10000 ms to each server test file. This is an attempt
to solve the timeout issues that we're experiencing with the Mocha
tests. Especially, this is hoping to address the build fails that are
caused by such timeouts.

Issue is described in meanjs/mean#955
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants