When the PHP memory limit is at 32M, the Drupal installer suggests I increase my memory limit to 32M.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

justafish’s picture

Possibly related. Memory limit is set to 64M and turning on the Testing Framework results in
The testing framework requires the PHP memory limit to be at least 64M. The current value is 64M. Follow these steps to continue.

David_Rothstein’s picture

Issue tags: +Novice

Looks like this was caused by #1453984: Color module doesn't test for unlimited memory. when the drupal_check_memory_limit() function was added there.

Should be a simple one-line fix to that function, plus a test. (Note there are existing tests in system/Tests/Bootstrap/MiscUnitTest.php in Drupal 8.)

Probably this is a good Novice issue, actually... Adding the tag accordingly.

disasm’s picture

Status: Active » Needs review
FileSize
1.58 KB

Attached is a patch that fixes the bug where requested memory limit == available_memory. Also, a simple test is written that tests 30MB,30MB as params asserts true.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. Also, I ran the tests locally without the fix and it failed correctly.

David_Rothstein’s picture

Looks good to me too, but maybe we need to update this code comment also, to reflect the change?

// - The memory limit is greater than the memory required for the operation.
disasm’s picture

I changed the patch. Here's the patch and an interdiff.txt. I wasn't sure what to do stylistically about the line wrapping to the next line since adding or equal to increased the line to longer than 80 cols. Take a look at what I did and let me know if it needs changed at all.

tim.plunkett’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/includes/bootstrap.incundefined
@@ -3409,6 +3409,7 @@ function drupal_check_memory_limit($required, $memory_limit = NULL) {
+  // - The memory limit is greater than or equal to the memory required for ¶
+  // the operation.

There is a trailing space on the first line, and I believe the second line should be indented

disasm’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
1.71 KB

attached is patch

tim.plunkett’s picture

Thanks! Re-RTBC.

webchick’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Looks like a good bug fix, includes tests!

Committed and pushed to 8.x. Will need a re-roll for D7.

tim.plunkett’s picture

Version: 7.x-dev » 8.x-dev
Status: Patch (to be ported) » Fixed

This should just be fixed correctly the first time in #1453984: Color module doesn't test for unlimited memory., as that wasn't committed yet. Thanks!

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