Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When running multiple test functions within a class something isn't working correctly so that test fails horribly. If the test functions are run individual everything works. I'm guessing this is why most the tests fail, as they used to work.
This is a very hard to catch/debug error. Chx and I have been trying to figure this out with little luck.
So far the only thing I can confirm is that if setUp
and the db_prefix portion of tearDown
are commented out the tests work.
From the our best reasoning chx and I believe this has to do with a caching issue.
Comment | File | Size | Author |
---|---|---|---|
#3 | simpletest_db_prefix.patch | 1 KB | boombatower |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedWe should consider running all tests with the batch API. This will prevent out of memory errors as well ( thats what i got when i ran all tests from within drush)
Comment #2
boombatower CreditAttribution: boombatower commented@moshe weitzman: Looks like a possibility. This doesn't fix the db_prefixing issue, but could prove useful. If you would write a patch that would be great.
@all: Batch API Documentation
Comment #3
boombatower CreditAttribution: boombatower commentedAfter allot of time spent debugging this (and tearing out hair) I have discovered what I believe to be the issue.
$this->_modules
array wasn't being reset and thus wasn't enabled repeat modules in the second test function. This, as you can imagine, creates havoc.The above was fixed with the addition of the following code:
Although the fix is quiet simple, coming to this conclusion took many hours of painstaking debugging. Now that this is fixed SimpleTest should be able to reliably flush the database after each test function has run and I can move on the clean out the issue queue.
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedvery nice detective work, boombatower. thanks.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.