Seems like simpletest runs out of time. Simpletest should check this value themself and also set it to 240 seconds where servers allows this.

An error occurred. /drupal6/batch?id=9&op=do <br /> <b>Fatal error</b>: Maximum execution time of 60 seconds exceeded in <b>\drupal6\sites\all\modules\simpletest\drupal_web_test_case.php</b> on line <b>818</b><br /> 

Comments

hass’s picture

No simpletest works at all any more. It shows the batch processing and than it stale. I don't know what it is doing there, but after the timeout I receive an unhelpful server 500 error. Doesn't matter if I use 60 or 240 seconds.

hass’s picture

1. Uninstalled simpletest v1.2 (has no uninstall)
2. Ok, simply delete the folder
3. Reloaded modules page
4. Extracted simpletest v2.5
5. Reloaded modules page
6. Activated simpletest module
7. Gone to admin/build/testing
8. Checked the "SimpleTest" and "Run tests"
9. After 5-10 seconds batch processing it gives me the following

An error occurred.
Please go the the error page.
An error occurred. /drupal6/batch?id=14&op=do 

10. Clicked the error page link.
11. Error page telling me "The tests did not successfully finish."

Any way to get this module working?

boombatower’s picture

Status: Active » Postponed (maintainer needs more info)

Can you try the latest HEAD for comparison and post your OS/server/PHP info. It works for myself and numerous others.

hass’s picture

Again after cleanup the system table and reinstall:

Running SimpleTests
SimpleTest is initializing... one test case will run.
Running SimpleTests

An error occurred.
Please go the the error page.
An HTTP-error 500 occurred. /drupal6/batch?id=18&op=do

batch?id=18:

a:8:{s:4:"sets";a:1:{i:0;a:12:{s:7:"sandbox";a:0:{}s:7:"results";a:0:{}s:7:"success";b:0;s:5:"title";s:19:"Running SimpleTests";s:10:"operations";a:1:{i:0;a:2:{i:0;s:27:"_simpletest_batch_operation";i:1;a:2:{i:0;a:1:{i:0;s:18:"SimpleTestTestCase";}i:1;s:1:"2";}}}s:8:"finished";s:26:"_simpletest_batch_finished";s:8:"redirect";s:19:"admin/build/testing";s:16:"progress_message";s:17:"Processing tests.";s:3:"css";a:1:{i:0;s:43:"sites/all/modules/simpletest/simpletest.css";}s:12:"init_message";s:64:"SimpleTest is initializing... one test case will run.<br/>&nbsp;";s:13:"error_message";s:30:"Es ist ein Fehler aufgetreten.";s:5:"total";i:1;}}s:11:"current_set";i:0;s:11:"progressive";b:1;s:3:"url";s:5:"batch";s:11:"source_page";s:19:"admin/build/testing";s:8:"redirect";N;s:2:"id";s:2:"18";s:13:"error_message";s:83:"Bitte gehen Sie zur <a href="/drupal6/batch?id=18&amp;op=finished">Fehlerseite</a>.";}
hass’s picture

Title: Maximum execution time of 60 seconds exceeded » HTTP-Fehler 500 error occurred running SimpleTests

Same again with latest DEV

Running SimpleTests

An error occurred.
Please go the the error page.
An HTTP-error 500 occurred. /drupal6/batch?id=21&op=do
hass’s picture

Title: HTTP-Fehler 500 error occurred running SimpleTests » HTTP-Error 500 occurred running SimpleTests
hass’s picture

Have simpletest module been tested with Drupal installed into a subdirectory?

hass’s picture

Any idea how I can get simpletest module working? I'd like to upgrade the googleanalytics tests, but I cannot test anything.

boombatower’s picture

@7: have you tried running it in the root? I use virtual hosts and thus never run into this issue.

I believe this does occur as I have had the issue when setting up testing.drupal.org and other testing slaves.

If you can confirm that it works without running in a sub directly then this needs to be solved in core and backported.

hass’s picture

I have totally no idea where I should start searching or debugging. Also tested D7 in a subdirectory and it is also not working on my IIS 5.1 with MySQL 5.x.

boombatower’s picture

I'm just asking if you can run the tests from the webroot. The simplest way may be to move the webroot to your D6 installation.

hass’s picture

I tried a brand new installation of D7 in web root. No success. Have this been tested under Windows? I will try in xampp environment asap.

boombatower’s picture

I thoughts it had, but less common for sure.

hass’s picture

Installed D6 into XAMPP Lite - works. Are there any known IIS issues or are you using Apache specific logics or variables? I have also tried without clean_url to verify if there is an issue with ISAPI_Rewrite, but it also haven't worked with clean_url's disabled on IIS.

boombatower’s picture

The only possibility that I know of would be

$_SERVER['USER_AGENT']
hass’s picture

Only as a side note - I've taken a look to the simpltest table and when the tests started I see ~800 exceptions not related to the modules test I'm currently running. All seems to be related to locale module and locale tables. After I've disabled the locale module and all depended modules all this exceptions are gone. I think this is part of the issue as I saw some tests are running out of time (240sec). This is from my Apache tests... I have had locale module, i18n, content translation and some others installed.

hass’s picture

Oh my goodness! Now all works in IIS, too.

Sooo... there is a bug together with locale module enabled!

boombatower’s picture

Status: Postponed (maintainer needs more info) » Fixed

This module has been tested quiet a bit and is almost identical to HEAD, so if you find an issue it is most likely not related or should appear in HEAD as well.

hass’s picture

Status: Fixed » Postponed (maintainer needs more info)

Maybe the title is not yet correct, but there is a bug in the module. Try to find why there are ~800+ _query() exceptions with locale module what causes the batch to timeout and server 500 errors.

hass’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new77.3 KB

Here is a dump from the two main simpletest tables + all temp simpletest tables from one run. If I'm running the google analytics test it completes and if I run the simpletest functionality test it crashes after some time. In the attached file you can see I have re-enabled the locale module before my latest tests.

From the errors I see something strange. All simpletest tables that are created (not to mention that there are tables missing) have a prefix simpletest155897, but locale module errors in "simpletest" table are showing exceptions with simpletest886421 prefix. And to make it more worse - latest inserts (id 355+) are showing simpletest155897 prefix again. All tables are from one run and there wasn't any stale data or tables from a prior run.

Setting back to active and I hope this don't need additional info as it is 100% reproduceable.

hass’s picture

I may found the source of the timeout issue.

If I call "/" I have an endless loop on my test site. This is caused by a bug in i18n module or language detection bug in locale module or both together. This causes an endless loop in the simpletest that never finishes if $this->drupalGet(''); is called. Firefox finishes after 20 redirects with an "endless redirect warning message", but simpletest not.

Have CURL also such a feature like FF have?

hass’s picture

This patch change curl to stop processing after 20 redirects. This may happen if you have an endless loop on the tested site. I've taken this limit from Firefox that also have an endless redirect detection and stops processing after 20 redirects. As this 20 redirects will take some good time to complete - a 90 seconds PHP timeout limit is not enough and I've added a timeout of 240 seconds what core and other modules also do in such situations.

Nevertheless it would be much better if simpletest would use proper batch processing and encapsulate every time consuming task (drupal_install_system, drupal_install_modules, rebuild caches and *every* test - not only one batch per .test file) in it's own batch process.

hass’s picture

Title: HTTP-Error 500 occurred running SimpleTests » Prevent endless loop and upper timeout in module
Status: Active » Needs review
StatusFileSize
new1.06 KB

Missed the patch.

boombatower’s picture

Title: Prevent endless loop and upper timeout in module » SimpleTest: Prevent endless loop and upper timeout during request
Project: SimpleTest » Drupal core
Version: 6.x-2.5 » 7.x-dev
Component: Code » simpletest.module
Category: bug » feature
Status: Needs review » Needs work

Stopping at 20 may screw up the redirect one...as when testing a batch API form it may redirect hundreds of time validly. Either way this should be fixed in D7 core and backported.

Personally I'm not sure that adding a limit is a good idea for the reason above specifically.

hass’s picture

I understand this redirection limit as a setting per execute. So every time you call curl execute you can have up to 20 redirects. Therefore this is only a stopper for endless loops - not for batch API at all... so no work here...

boombatower’s picture

Please provide a 7.x version of the patch and mark the issue as CNR so that the testing bot will run it through its phases, otherwise I believe what you said in #25 makes sense since batch API uses meta refresh which the SimpleTest browser searches for and redirects through another drupalGet call.

If curl was performing the redirects then it would stop the batch API as it normally uses JavaScript which obviously SimpleTest does not evaluate.

shaikafrose’s picture

Status: Needs work » Closed (duplicate)
hass’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new1.18 KB

Patch attached.

dries’s picture

I'm cool with the CURL option but the 240s timeout value seems very random to me. Can't we just go with the CURL option? It is much more portable.

hass’s picture

I can also set the timeout myself in PHP settings file, but for me it times out today with 90s and 240s not. 240s was a value that is already used in node.module, common.inc, locale.inc, devel, and some other modules. It's a high limit, but it's better then 0 what could hang up the PHP process for ages.

hass’s picture

hass’s picture

hass’s picture

Something goes wrong here... my comments are missing...

I have removed the time-out limit and reduced the redirection limit to 5 as 20 seems to be useless to me and is also too much. Use the patch in #32, please.

dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

hass’s picture

Version: 7.x-dev » 6.x-dev
Status: Fixed » Patch (to be ported)

THX, needs backport.

hass’s picture

Project: Drupal core » SimpleTest
Version: 6.x-dev » 6.x-2.x-dev
Component: simpletest.module » Code

Moving to simpletest issue queue

boombatower’s picture

Status: Patch (to be ported) » Fixed

2.8 is a fresh backport.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.