(See upstream testem PR: testem/testem#819)
Since around 2012, WebKit and other browsers have throttled timers (like setTimeout
) to only a max of once per second in inactive tabs.
For some test suites, this may never be an issue. But, for example, in a very large Ember test suite with >1000 acceptance tests and much custom code, it manifested as often flaky and non-deterministic test timeouts, even in headless CI environments with Chrome in xvfb.
This has caused much much testing pain that might manifest as the not-obviously-related error:
Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.
Also see things like:
Command line option to allow background windows to run unthrottled. This is for tools like Karma/Jasmine and other testing tools that run continuously in the background. The launched browser running the tests can be minimized as all test output goes to the console. However when the window is minimized the throttling takes effect and makes testing impossible.
Chrome 49 stable finally supports both of these flags:
--disable-background-timer-throttling
--disable-renderer-backgrounding