Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This patch to fix the notice error when running the test: testCheckMemoryLimit().
Comment | File | Size | Author |
---|---|---|---|
#16 | 3023066.patch | 1.34 KB | Pol |
Screenshot_2018-12-30 Test result Site name(1).png | 84.8 KB | Pol |
Comments
Comment #2
PolComment #3
mfbFiltering the memory limit doesn't work as it could be specified in bytes, GB, etc.
Instead, we need to either parse the memory limit using parse_size(), or manually find the size, multiply, and recombine with any unit.
Comment #4
mfbOops that wasn't quite right, because MB was being tacked on to the byte size, which meant that the memory limit was multiplied by 1024 * 1024 * 2 instead of 2 :)
Comment #5
PolComment #6
Fabianx CreditAttribution: Fabianx as a volunteer commentedUnless I miss something the same problem exists in Drupal 8 in this file:
core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php
It needs to be fixed there first, before we can commit it to Drupal 7.
Comment #7
PolThanks for your input Fabian, I will provide a patch for D8 asap as well.
Comment #8
PolAn issue for D8 has been created: #3024259: [PHP 7.3] Fix EnvironmentTest::providerTestCheckMemoryLimit() notice.
Comment #9
alexpottAs commented on the D8 issue. On DrupalCi this value is -1 in CLI. So this test is not testing what we think it is. I would replace
$twice_avail_memory
with something absurd like3000000YB
Comment #10
mfbHahaha I am trying to imagine what is 3,000,000 YB of RAM and have been unable to. That is way beyond the largest supercomputers or the 64-bit architecture limit. If every human being on the planet had like 100 billion smartphones each, then that would get you in the ballpark.
Comment #11
PolComment #12
PolUpdated patch.
Comment #13
PolComment #14
PolAll good for me locally!
Comment #15
Fabianx CreditAttribution: Fabianx as a volunteer commentedLet's sync this with the D8 changes made before committing.
Comment #16
PolUpdated patch - just changed the comment, it's now in sync with Drupal 8 comment.
Comment #17
Fabianx CreditAttribution: Fabianx as a volunteer commentedBack to RTBC
Comment #19
PolThanks all !!!