This patch to fix the notice error when running the test: EnvironmentTest::testCheckMemoryLimit().

A non well formed numeric value encountered

This patch comes from #3023066: [PHP 7.3] Fix BootstrapMiscTestCase::testCheckMemoryLimit() notice.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Pol created an issue. See original summary.

Pol’s picture

Version: 7.x-dev » 8.7.x-dev
Component: bootstrap system » phpunit
Status: Postponed » Active
Pol’s picture

Status: Active » Needs review
FileSize
881 bytes
Pol’s picture

FileSize
881 bytes

The last submitted patch, 3: 3024259.patch, failed testing. View results

alexpott’s picture

Why isn't EnvironmentTest::providerTestCheckMemoryLimit() failing on the DrupalCI when PHP 7.3 runs against HEAD?

alexpott’s picture

Status: Needs review » Needs work

Lol I know why. This test is very bogus. On DrupalCI the CLI limit is likely the same as my local - it's -1 to $twice_avail_memory gets set to -2MB which is nonsense. I think we should replace $twice_avail_memory with 3000000YB cause that is absurd.

Pol’s picture

Status: Needs work » Needs review
FileSize
1.18 KB

Here's the updated patch.

Fabianx’s picture

Status: Needs review » Reviewed & tested by the community

Looks good :)

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed e57c4a13e6 to 8.7.x and 7041c1c520 to 8.6.x. Thanks!

  1. +++ b/core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php
    @@ -44,14 +44,11 @@ public function testCheckMemoryLimit($required, $custom_memory_limit, $expected)
           // Exceed a custom (unlimited) memory limit.
    

    Let's change this to // Test an unlimited memory limit.

  2. +++ b/core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php
    @@ -44,14 +44,11 @@ public function testCheckMemoryLimit($required, $custom_memory_limit, $expected)
    diff --git a/sites/default/default.services.yml b/sites/default/default.services.yml
    
    diff --git a/sites/default/default.services.yml b/sites/default/default.services.yml
    old mode 100644
    new mode 100755
    diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
    
    diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
    old mode 100644
    new mode 100755
    

    This shouldn't be here...

Fixed this all on commit.

  • alexpott committed e57c4a1 on 8.7.x
    Issue #3024259 by Pol, alexpott: [PHP 7.3] Fix EnvironmentTest::...

  • alexpott committed 7041c1c on 8.6.x
    Issue #3024259 by Pol, alexpott: [PHP 7.3] Fix EnvironmentTest::...
Pol’s picture

Looks like I wasn't really awake in the train this morning, thanks for fixing it @alex !!

Status: Fixed » Closed (fixed)

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