jamesshore / quixote

CSS unit and integration testing
Other
848 stars 45 forks source link

Error: timeout of 2000ms exceeded. #30

Closed cweems closed 8 years ago

cweems commented 8 years ago

When running the example (quixote/example) I received the following error:

Chrome 51.0.2704 (Mac OS X 10.11.5) Media Object CSS "before all" hook FAILED
    Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
        at /Users/charlesweems/Documents/Projects/quixote_example/example/vendor/quixote.js:1548:5
        at /Users/charlesweems/Documents/Projects/quixote_example/example/vendor/quixote.js:1590:12
        at /Users/charlesweems/Documents/Projects/quixote_example/example/vendor/quixote.js:1628:10
.
Chrome 51.0.2704 (Mac OS X 10.11.5): Executed 2 of 6 (1 FAILED) (6.154 secs / 2.731 secs)
jake aborted.

I managed to get passing tests by adding this.timeout(15000) in line 17 of _media_css_test.js per this Stack Overflow post. Even so, the example tests are taking about 5 seconds to complete:

Chrome 51.0.2704 (Mac OS X 10.11.5): Executed 6 of 6 SUCCESS (5.169 secs / 0.008 secs)

My question: should I add timeouts to all of the tests, or is the lack of speed here symptomatic of something else?

Thanks for your fantastic work on this!

jamesshore commented 8 years ago

This is documented in the "gotchas" section of the readme. In Webkit-based browsers, if the test page isn't visible on screen, it's deprioritized and runs very slowly. So you need to make sure some part of the page is visible. The this.timeout() change isn't necessary if you do that.

cweems commented 8 years ago

@jamesshore Thanks so much! I did indeed have Chrome full screen in one Mac desktop and my terminal full screen on another desktop. Moving them to the same window so that the browser was visible made the tests almost instantaneous.

jamesshore commented 8 years ago

Glad that fixed it!