Fix MaintenanceModeTest test failures

Created on 29 July 2024, 10 months ago
Updated 1 August 2024, 10 months ago

The MaintenanceModeTest test occasionally fails, e.g.: https://git.drupalcode.org/project/metatag/-/jobs/2265753

Drupal\Tests\metatag\Functional\MaintenanceModeTest 0 passes 1 exceptions
FATAL Drupal\Tests\metatag\Functional\MaintenanceModeTest: test runner returned a non-zero error code (2).
Drupal\Tests\metatag\Functional\MaintenanceModeTest 0 passes 1 fails

---- Drupal\Tests\metatag\Functional\MaintenanceModeTest ----
Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Exception Other      phpunit-6.xml        0 Drupal\Tests\metatag\Functional\Mai
    PHPUnit Test failed to complete; Error: PHPUnit 9.6.20 by Sebastian
    Bergmann and contributors.
    
    Testing Drupal\Tests\metatag\Functional\MaintenanceModeTest
    E                                                                   1 / 1
    (100%)
    
    Time: 00:07.916, Memory: 4.00 MB
    
    There was 1 error:
    
    1) Drupal\Tests\metatag\Functional\MaintenanceModeTest::testUser1
    Behat\Mink\Exception\ExpectationException: The string "Access denied | "
    appears in the HTML response of this page, but it should not.
    
    /builds/project/metatag/vendor/behat/mink/src/WebAssert.php:888
    /builds/project/metatag/vendor/behat/mink/src/WebAssert.php:380
    /builds/project/metatag/web/core/tests/Drupal/Tests/WebAssert.php:566
    /builds/project/metatag/tests/src/Functional/MaintenanceModeTest.php:59
    /builds/project/metatag/vendor/phpunit/phpunit/src/Framework/TestResult.php:729
    
    ERRORS!
    Tests: 1, Assertions: 3, Errors: 1.
    
    HTML output was generated
    http://localhost/web/sites/simpletest/browser_output/Drupal_Tests_metatag_Functional_MaintenanceModeTest-1-83011154.html
    http://localhost/web/sites/simpletest/browser_output/Drupal_Tests_metatag_Functional_MaintenanceModeTest-2-83011154.html
Fail      run-tests. Unknown              0 Unknown                            
    FATAL Drupal\Tests\metatag\Functional\MaintenanceModeTest: test runner
    returned a non-zero error code (2).
πŸ› Bug report
Status

Active

Version

2.0

Component

Tests

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @DamienMcKenna
  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Doing a little debugging on this, the problem is that the after maintenance mode is set and the render cache is invalidated, loading the user/1 page again results in the "Access denied" message instead of the "Site under maintenance" message.

    So for some reason the output cache was not invalidated as expected.

Production build 0.71.5 2024