Problem/Motivation
Two systems, both PHP 5.5.3, with Opcode cache enabled, can't see any obvious different settings.
Running tests on one of them works fine, fails on the other, because the repeated require of test settings.php is cached and reads an old version without config directories.
Proposed resolution
I can fix it by adding
opcache_invalidate(DRUPAL_ROOT . '/' . $conf_path . '/settings.php', TRUE);
call in drupal_settings_initialize()
force the invalidation, but that doesn't make much sense and we want to avoid it on actual sites, obviously.
Adding a (global) opcache_reset()
in WebTestBase::setUp()
works, too.
clearstatcache()
did not help.
Comment | File | Size | Author |
---|---|---|---|
#6 | drupal8.opcache.6.patch | 981 bytes | sun |
#1 | remove-reload-settings-2194071-1.patch | 604 bytes | Berdir |
Comments
Comment #1
BerdirWhat does seem to work for me is to remove that call.
Comment #3
sunAdjusting the issue title a little bit; I'm consistently mistaking this browser tab as the core "Issues" tab. ;)
Comment #4
Berdir1: remove-reload-settings-2194071-1.patch queued for re-testing.
Comment #6
sunNow, that test failure is essentially the expected failure and the reason for why I added that call to
drupal_settings_initialize()
:The idea was to guarantee that the test operates on the actual information in
settings.php
, and not just some global state and global variables that just coincidentally might happen to have the same or similar information assettings.php
.Point in case here:
WebTestBase::setUp()
writes$settings['simpletest_parent_profile']
intosettings.php
, before executing the installer.drupal_settings_initialize()
ensures that all global state/variables that are solely controlled bysettings.php
will actually represent the actually contained values forSettings
+global $base_url, $databases, $cookie_domain, $drupal_hash_salt, $config_directories, $config;
Due to that, I would actually prefer to put something along the lines of this into
WebTestBase::setUp()
:That said, I wonder whether this refresh doesn't actually belong into
drupal_rewrite_settings()
, because that is where the PHP file gets actually rewritten?Let me actually attach that as a patch. Can you try it out? (I didn't upgrade yet)
Comment #7
sunThat said, you mentioned that you're able to reproduce this on one of your two PHP 5.5 boxes only?
Comment #8
BerdirNope, on both on the next day, I guess I was just too stupid to do a git pull :)
Anyway, just had a confirmation that I'm not the only one seeing this, so raising to critical.
Comment #9
catch@berdir would you mind checking the value of opcache.validate_timestamps?
Comment #10
mikeytown2 CreditAttribution: mikeytown2 commentedThis seems to be a duplicate of #779482: Installation failure when opcode cache is enabled
Linked issue tries to fixes it for other opcode caches as well.