Reset module_list() and module_implements() on test setup.

Darren Oh - April 21, 2009 - 20:12
Project:Drupal
Version:7.x-dev
Component:simpletest.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

I don't know if this causes problems in Drupal 7, but with simpletest on Drupal 6, if module_exists() is called during set-up, the result is wrong because the static variable is not refreshed until after the modules are installed.

AttachmentSizeStatusTest resultOperations
drupal_web_test_case.php_.patch855 bytesIdleFailed: Failed to apply patch.View details | Re-test

#1

Darren Oh - April 21, 2009 - 20:25

Patch for Drupal 6 at http://drupal.org/node/440836.

#2

Arancaytar - May 20, 2009 - 18:58
Title:Error when installation uses module_exists()» Reset module_list() and module_implements() on test setup.

Seems to be in order for now, but be aware that module.inc is going to be converted to the static caching API, and these calls may then have to be replaced with drupal_static_reset('module_list') etc. Depending on whether the $reset parameter is removed from these, which is still debated.

The issue to follow is #422370: convert mail.inc, module.inc, and pager.inc to use new static caching API.

#3

System Message - May 24, 2009 - 23:20
Status:needs review» needs work

The last submitted patch failed testing.

#4

Dave Reid - May 25, 2009 - 23:38

This patch fixes the errors a lot of us are seeing in D6 and D7 with exceptions with tables not found (cache_update, etc).

#5

boombatower - May 26, 2009 - 16:48
Status:needs work» needs review

Re-roll.

AttachmentSizeStatusTest resultOperations
440824-module-reset.patch908 bytesIdlePassed: 11571 passes, 0 fails, 0 exceptionsView details | Re-test

#7

Darren Oh - June 1, 2009 - 14:19

The root problem is that the module list from the previous test is being used during the setup the next test. This patch actually fixes the problem, rather than working around it.

P.S. I now see that the other issue fixes the install system rather than the testing system, so it's not a workaround. My main concern was to make the testing system work the same way as enabling modules on the module administration page. That patch would do that.

#8

Darren Oh - June 1, 2009 - 14:20
Status:needs review» duplicate

Since the other patch appears to have a good chance of being committed, I'm setting the status of this issue to duplicate.

#9

boombatower - June 1, 2009 - 21:29

This patch does not fix both problems, but the other patch does so lets stick with that one.

 
 

Drupal is a registered trademark of Dries Buytaert.