Problem/Motivation
CI Builds (example: https://git.drupalcode.org/project/drupal/-/jobs/6080555) are failing on docroot/core/modules/system/tests/src/Functional/System/StatusTest.php:
Status (Drupal\Tests\system\Functional\System\Status)
✘ Status page
┐
├ Failed asserting that true is false.
│
│ /builds/project/drupal/core/modules/system/tests/src/Functional/System/StatusTest.php:207
┴
✔ Error element count
✔ Warning element count
FAILURES!
Tests: 3, Assertions: 46, Failures: 1, PHPUnit Deprecations: 8.
Browser output shows that the failure is coming from a warning generated on APCu size:
Enabled (2.93 GB)
Depending on your configuration, Drupal can run with a 2.93 GB APCu limit. However, a 32 MB APCu limit (the default) or above is recommended, especially if your site uses additional custom or contributed modules.
This does not make much sense, since 2.93 GB is clearly much larger than 32 MB.
Relevant code is in Drupal\system\Install\Requirements\SystemRequirements:
$memory_info = apcu_sma_info(TRUE);
$apcu_actual_size = ByteSizeMarkup::create($memory_info['seg_size'] * $memory_info['num_seg']);
$apcu_recommended_size = '32 MB';
$requirements['php_apcu_enabled']['value'] = t('Enabled (@size)', ['@size' => $apcu_actual_size]);
if (Bytes::toNumber(ini_get('apc.shm_size')) * ini_get('apc.shm_segments') < Bytes::toNumber($apcu_recommended_size)) {
$requirements['php_apcu_enabled']['severity'] = RequirementSeverity::Warning;
$requirements['php_apcu_enabled']['description'] = t('Depending on your configuration, Drupal can run with a @apcu_size APCu limit. However, a @apcu_default_size APCu limit (the default) or above is recommended, especially if your site uses additional custom or contributed modules.', [
'@apcu_size' => $apcu_actual_size,
'@apcu_default_size' => $apcu_recommended_size,
]);
}
This was last changed in #3466399: APCu requirement for 32M is checking wrong value.
Steps to reproduce
Proposed resolution
Stopgap: skip the assertions on APCu stats in core/modules/system/tests/src/Functional/System/StatusTest.php. This has already been committed.
Next steps: address that apc.shm_segments ini settings has been removed in APCu/5.1.25, making the computed value 0 because of multiplication by an empy value. Use a fallback value of 1 and restore the test.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3539331
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
nicxvan commentedInvestigation here: https://drupal.slack.com/archives/C079NQPQUEN/p1754057444000909 that links to the original discussion in htmx where I found this.
Comment #3
dwwMisplaced parens?
Don’t we want:
?
Comment #4
dwwOpening an MR to try that
Comment #5
dwwBah, sorry. I hadn't looked at the ini_get() docs about apc settings. apc.shm_size indeed can come back as "32 MB" and friends, which is what we want to convert to a number before we multiply it by the number of segments.
Comment #6
godotislateIt might be good to print what
ini_get('apc.shm_size')andini_get('apc.shm_segments')actually are now in the build env, and whether something isn't converting those values right inBytes::toNumber.Comment #7
godotislate@catch also suggested in slack that maybe we disable Status test for now to get builds working, then reinstate after finding the root cause.
Comment #9
dwwInitial MR to skip the test for now.
Comment #10
godotislateLet's do this and unblock some builds.
Comment #12
godotislateOpened MR to check what the APC values were per #6, and it looks like
ini_get('apc.shm_segments')might be empty, which would certainly be a problem.https://git.drupalcode.org/issue/drupal-3539331/-/jobs/6083955
Comment #13
godotislateOK so
apc.shm_segmentshas apparently been removed:https://git.drupalcode.org/project/drupalci_environments/-/blob/dev/php/...
https://pecl.php.net/package/APCu/5.1.25
Comment #18
catchCommitted/pushed to 11.x and cherry-picked to 11.2.x, 10.6.x and 10.5.x, thanks!
Don't usually like multiple commits from a single issue but given skipping the test is an emergency stop-gap let's leave this open and continue here maybe?
Comment #22
godotislateOK, used a ternary to set fallback multiplier of 1 if
ini_get('apc.shm_segments')is empty. This passes tests in MR 12895.Comment #23
dwwHah, bit of duplicated effort, since I had started down that same road.
However, it's not just
ini_get('apc.shm_segments')that can be empty. So, too, canapcu_sma_info(TRUE)['num_seg']. So I moved the fallback check into a local var, and use that everywhere we check this, either directly or viaapcu_sma_info().Comment #25
nicxvan commentedProbably not critical anymore.
Comment #26
godotislateComment #27
andypostFYI I did upgrade of APCu to 5.1.26 for DrupalCI https://pecl.php.net/package/APCu/5.1.25
Comment #28
andypostComment #29
godotislateSince #3538854: APCu requirement for 32MB always displays since APCu 5.1.25 was filed first, I guess we could close this one as fixed (with the stopgap) and copy the open MR here over there. Or close that one as a duplicate.
Comment #30
dwwAgreed with #29. It'll be cleaner for the Git history, too. I opened an MR over there with the latest code from here. Restoring the original (critical) scope and marking fixed.
Thanks,
-Derek
Comment #31
dww