Currently, HTTP requests via simpletest change the user agent in order to hit the test database rather than the real database. In bootstrap.inc, a check is made to see if the stated request time of the request is within a five-second window, which seems reasonable for _single_ local requests.
How the Selenium project deals with the problem
The Selenium module, which integrates with Selenium to test code in real browsers, provides a patch to core which replaces the hard-coded 5 second window by a hard-coded 500-second window.
Example usage for Simpletest PhantomJS integration
My idea is to provide a hook_init implementation within Simpletest PhantomJS to exit if the call to Simpletest is outside the 5-second window, but any test which takes more than 5 seconds will then break.
Use 5 seconds a default behaviour, but allow site developers to add something like the following in their settings.php file:
$conf['simpletest_time_window'] = 500;
|FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2104139-3-core-8.x-simpletest-dont-hardcode-5-sec-window.patch. Unable to apply patch. See the log in the details link for more information. |
[ View ]
|FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2104139-1-core-7.x-simpletest-dont-hardcode-5-sec-window.patch. Unable to apply patch. See the log in the details link for more information. |
[ View ]