Steps to reproduce:
- Run any one of the database tests
- On the results page, reload (admin/build/testing)

Error:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'database_test_query_alter' was given in /home/davereid/Projects/drupal-head/includes/common.inc on line 2750.

My guess would be that the database tests are not properly unloading the database_test.module somehow and trying to use the _query_alter on a non-test database query.

Comments

dave reid’s picture

Title: warning: call_user_func_array(): First argument is expected to be a valid callback, 'database_test_alter_query' » Warning after running database tests - call_user_func_array() with 'database_test_alter_query'

Little better title.

damien tournoud’s picture

Title: Warning after running database tests - call_user_func_array() with 'database_test_alter_query' » Module implementation cache not flushed properly by Simpletest
Component: database system » base system
Priority: Minor » Critical

This is the combination of two issues:

1. DWTC->tearDown() don't flush the module_implements() static cache (this is bad)
2. there is no way to flush registry_cache_hook_implementations() static cache, so implementations of all modules loaded across a page request will get saved to the registry cache at the end of the request (when drupal_footer is called), even if the module_implements() static cache is properly flushed ===> the rogue implementations will be reloaded at the next request! (this is even worse)

(1) could be solved by a patch to DWTC... (2) is already solved by #298600: DBTNG: make module_implements work regardless of bootstrap phase.

Bumping to critical, since that could have other side-effects.

damien tournoud’s picture

Now that #298600: DBTNG: make module_implements work regardless of bootstrap phase when in, this is now worse: the implementation is permanently staying...

damien tournoud’s picture

Status: Active » Needs review
StatusFileSize
new916 bytes

Easy fix.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the fix.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

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