This patch - http://drupal.org/node/402896#comment-4563554 fails horribly with simpletest.
Here's why:
- CacheArrayObject has a __destruct() function, this tries to acquire a lock and/or cache_set() - which in core hits the database.
- the patch was adding the schema CacheArrayObject() to drupal_static()
- DrupalUnitTestCase::setUp() calls drupal_static_reset()
- drupal_static_reset() takes the static variable out of scope.
- this calls the object destructor, which queries the database, except it's no longer there.
Possible options:
1. Remove the drupal_static_reset() - afaik all tests pass with it removed and it's there theoretically.
2. Call drupal_static_reset() before the database is moved out of the way, it could be called again later on too if necessary.
Comment | File | Size | Author |
---|---|---|---|
#2 | destruct.patch | 1.11 KB | catch |
Comments
Comment #1
sunComment #2
catchHere's a patch.
Comment #3
sunDon't we have to backup the DB connection info first, so we can restore it later?
14 days to next Drupal core point release.
Comment #4
catchThat's neither held in drupal_static() nor $conf though..
Comment #5
sunThis has been fixed via #1541958: Split setUp() into specific sub-methods and/or some other patches already.