Download & Extend

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

Project:Drupal core
Version:7.x-dev
Component:simpletest.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

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

Comments

#1

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

#2

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: Revisit and convert mail.inc, module.inc, pager.inc to use static caching API.

#3

Status:needs review» needs work

The last submitted patch failed testing.

#4

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

Status:needs work» needs review

Re-roll.

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

#6

#7

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

Status:needs review» closed (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

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

#10

Duplicate of what?
I'm lost.

nobody click here