-
Notifications
You must be signed in to change notification settings - Fork 779
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
added optional timeout to phantomjs runner #415
added optional timeout to phantomjs runner #415
Conversation
Just to clarify: You are referring to an |
Correct, that is the example I ran into.
|
OK, thanks for clarifying. Changes looks good to me. 👍 |
@milimetric: You need to sign the CLA before we can work on merging this PR. Please add a comment here when you've done so. Thanks! |
I see you've signed now, @milimetric. Thanks! |
Landed, thanks! |
Has this proven to be an actual problem? Or just in theory? Afaik QUnit has a built-in timeout handler that should be more than enough. It is implemented on the test level (not the global level) so we may want to keep this global timeout as well (at the phantomjs level here), but I think in most cases you'll want to keep the global timeout in phantomjs disabled and instead use the one in QUnit so you don't end up with incomplete output when it is aborted (depending on the formatter and whether the formatter lives in the browser or in node, you could end up with invalid json/xml or whatever). The It has the advantage of letting everything else still run (instead of aborting everything). That way you have a more complete list of failures instead of just the first one (makes for more efficient working when fixing them by being able to fix more than one at once instead of having to re-run it after each one to find out the next possible failure). Another advantage is that the per-test timeout scales better as you don't have to update it periodically as your test suite grows (fast tests but more of them). As said, the phantomjs timeout can still be useful so we should definitely keep it. But I just wanted to make sure you're also aware of |
@Krinkle: As you said, I think this is still valid separately. However, perhaps we need to start documenting more about the |
I didn't know about QUnit.config.testTimeout, and I agree with Timo's reasons for
|
Yep, the doc site is still fairly new. There's a lot of things not documented there yet. This is one of them. I've filed qunitjs/api.qunitjs.com#21. |
These properties were there, we have an infrastructure issue that prevents them from being rendered: jquery/grunt-jquery-content#31 - doesn't make a difference for the user though. |
If an async test has a problem and hangs, the phantomjs qunit runner would hang as well. I added an optional timeout as the third parameter and updated the usage text in the readme. I've tested the change with both working and broken async tests.