Closed (fixed)
Project:
SimpleTest
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
22 Jan 2010 at 09:20 UTC
Updated:
21 Oct 2010 at 21:40 UTC
Jump to comment: Most recent file
I got this error when running a test batch with more than one test case:
[Fri Jan 22 10:01:06 2010] [error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required '' (include_path='.:/usr/lib/php5/20060613+lfs:/var/www/brgm/test/www:/var/www/test/www/include') in /var/www/test/www/sites/all/modules/devel/simpletest/simpletest.module on line 211, referer: http://test.guinevere/batch?op=start&id=90
[Fri Jan 22 10:01:06 2010] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://test.guinevere/batch?op=start&id=90
[Fri Jan 22 10:01:06 2010] [error] [client 127.0.0.1] PHP 1. {main}() /var/www/test/www/index.php:0, referer: http://test.guinevere/batch?op=start&id=90
[Fri Jan 22 10:01:06 2010] [error] [client 127.0.0.1] PHP 2. menu_execute_active_handler() /var/www/test/www/index.php:18, referer: http://test.guinevere/batch?op=start&id=90
[Fri Jan 22 10:01:06 2010] [error] [client 127.0.0.1] PHP 3. call_user_func_array() /var/www/test/www/includes/menu.inc:348, referer: http://test.guinevere/batch?op=start&id=90
[Fri Jan 22 10:01:06 2010] [error] [client 127.0.0.1] PHP 4. system_batch_page() /var/www/test/www/includes/menu.inc:0, referer: http://test.guinevere/batch?op=start&id=90
[Fri Jan 22 10:01:06 2010] [error] [client 127.0.0.1] PHP 5. _batch_page() /var/www/test/www/modules/system/system.admin.inc:1809, referer: http://test.guinevere/batch?op=start&id=90
[Fri Jan 22 10:01:06 2010] [error] [client 127.0.0.1] PHP 6. _batch_do() /var/www/test/www/includes/batch.inc:34, referer: http://test.guinevere/batch?op=start&id=90
[Fri Jan 22 10:01:06 2010] [error] [client 127.0.0.1] PHP 7. _batch_process() /var/www/test/www/includes/batch.inc:106, referer: http://test.guinevere/batch?op=start&id=90
[Fri Jan 22 10:01:06 2010] [error] [client 127.0.0.1] PHP 8. call_user_func_array() /var/www/test/www/includes/batch.inc:189, referer: http://test.guinevere/batch?op=start&id=90
[Fri Jan 22 10:01:06 2010] [error] [client 127.0.0.1] PHP 9. _simpletest_batch_operation() /var/www/test/www/includes/batch.inc:0, referer: http://test.guinevere/batch?op=start&id=90
Is it a real bug or did I miswrote my tests?
What's disturbing here is when I run a batch with only one test case, it works fine.
PHP reports that the error comes from this particular three lines of code:
/**
* Batch operation callback.
*/
function _simpletest_batch_operation($test_list_init, $test_id, &$context) {
..
// Drupal 6.
require_once drupal_get_path('module', 'simpletest') . '/drupal_web_test_case.php';
$classes = simpletest_test_get_all_classes();
require_once $classes[$test_class]['file'];
..
}
It might be a backport side effet ?
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | 692358-loading-file.patch | 659 bytes | boombatower |
| #12 | simpletest.module-692358.patch | 499 bytes | mdorrell |
Comments
Comment #1
boombatower commentedHave you cleared your cache and please try this on the latest dev.
Comment #2
pounardCache has been cleared about a thousand times, Drupal and SimpleTest cache.
CCK and SimpleTest test cases work as expected.
Note: I use only DrupalUnitTestCase as parent class (I'm writing API tests, not functionnal tests). The bug seems to happen only when there is more than one DrupalUnitTestCase test case in the batch (I have one DrupalWebTestCase, and I can include it with a single other DrupalUnitTestCase, whatever is I tried them all, it works).
I'll try the -dev version in the next hours.
Comment #3
pounardHi! Sorry I took my time (a lot of work).
I finally tested with latest -dev version (dated January 27th), and I get more or less the same error:
And I confirm that when I run a batch with many DrupalWebTestCase test suites, it works, when I run a batch with one or more DrupalWebTestCase and only one DrupalUnitTestCase, it works, and when there is two or more DrupalUnitTestCase, it always fail.
EDIT: I'd like to try with another module's implementation which contains more than one DrupalUnitTestCase, but it seems that unit tests are not widely used. If you known such module, I'll test with it to be sure this problem is not due to my environment.
Comment #4
pounardStill nobody alive here? Sorry to bother in the issue queue, but if you need more information, I can do a lot of stuff, just tell me what you need. This issue is quite annoying for me since I'm currently working on pretty big modules and I need to heavy test them :)
Comment #5
boombatower commentedJust need to find time to figure this out myself, unless you want to debug it.
Comment #6
pounardI might get to this point, I'll tell you if I do so.
Comment #7
pounardI tested with other module's test (feeds module tests actually) and I experienced the same error. A feeds maintainer tested its side and said it worked. The main difference between both environments is I use PHP 5.3.
Comment #8
alex_b commentedMay be related? #709646-1: Breaks batched processes
Comment #9
pounard@alex_b
Hum at first look I'd say no, but I might be wrong.
@boombatower
More information about what is happening, the reason why it fails is here (I'm cc-ing code on which I'll add comments).
simpletest.module, line 209
simpletest.module, line 401
Hope it can help.
Comment #10
pounard@boombatower
I'm sure now, after some variable dumps, that $pre and $post are the same when running my batch (but it remains weird, it happens only when I have 2 or more DrupalUnitTestCase in the same group).
Comment #11
pounardA lot of time passed since, and I changed of linux distro, Drupal core version, modules version, still using SimpleTests and I can't reproduce this bug, I think it was environment related (may be APC or something like this), unable to reproduce it, I close this issue.
Comment #12
mdorrell commentedI have experienced the same issue, this shouldn't be closed. It seems to be because the module tries to require_once on an empty file. I have attached a patch that will fix this issue.
Comment #13
pounardI think when trying to find out the bug cause on my environment I indeed though this part of the code was the source, but I wasn't really sure. The fact is I never got the bug again since so I can't really confirm.
Comment #14
mdorrell commentedThanks for responding so quickly. When I was stepping through the code, it didn't really make sense that it was returning the empty file, but its probably worth checking for that before the require_once call. Maybe you could add that into the next version.
Comment #15
pounardAsk this to the module maintainers :)
Comment #16
BrotherWolf commentedHiya,
Just came across the same problem.
Tests are DrupalUnitTestCase with two Tests in same group.
Platform is Windows 7/PHP 5.29 on ZendServer.
Can confirm that this patch gets round this issue with SimpleTest.
Hats off to mdorrell for debugging and fixing, and agree that this shouldn't be closed.
Comment #17
mdorrell commented@pounard Sorry, I just assumed you were the maintainer since you seemed to know so much about this.
@BrotherWolf Thanks, I this has been working for us on our system for a while now, so it seems safe.
I am kind of new to giving back to the community, so I don't really know if I have submitted this patch correctly. Can anyone out there help me get this pushed through to the next version?
Comment #18
boombatower commentedYour patch didn't apply cleaning...not sure if it was out of date or whatever. I updated it and committed.