My tests use the feedapi module and as part of creating the feeds, create new taxonomy terms. When run individually the tests are successfully. When more than one test is run in sequence the first succeeds while the second has errors. The source seems to be the static cache of the taxonomy terms linked into the feed node which remain in memory. I've tried without success using the various reset flags on node_load() as well as hacking the taxonomy and feedapi functions to force them to clear their static function caches, e.g., added a $reset parameter to taxonomy_node_get_terms() and taxonomy_get_term(), and feedapi_get_settings().

Since I can't find all the places the static data is being maintained I'm looking for the best practice way to force all statically cached data to be cleared as part of the setup of a test, e.g., somehow to unload and reload the feedapi and taxonomy modules?

Do I need to break these tests up into separate classes?

Comments

boombatower’s picture

Status: Active » Closed (works as designed)

Breaking up into multiple classes won't change anything.

This is a nasty issue...which really requires an overhaul of simpletest (which I plan to do for Drupal 7 once released in contrib). Drupal 7 gets around this with drupal_static() which allows all statics to be cleared at once, but Drupal 6 has no such mechanism.

Wish I had a better answer, but there really isn't a nice way to clear the statics.