Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70734

Random behat failures with tool_httpsreplace scenarios (timeout)

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Download the attached MDL-70734.patch file to the moodle site root folder and run the command git apply MDL-70734.patch in order to apply the following patch:

        diff --git a/admin/tool/httpsreplace/classes/url_finder.php b/admin/tool/httpsreplace/
        classes/url_finder.php
        index 8dc141616b9..95384e9c5e1 100644
        --- a/admin/tool/httpsreplace/classes/url_finder.php
        +++ b/admin/tool/httpsreplace/classes/url_finder.php
        @@ -151,6 +151,7 @@ class url_finder {
         
                 $numberoftables = count($tables);
                 $tablenumber = 0;
        +        sleep(31);
                 foreach ($tables as $table) {
                     if ($progress) {
                         $progress->update($tablenumber, $numberoftables, get_string('searchin
        g', 'tool_httpsreplace', $table));
        

      2. Run the httpsreplace (--tags '@tool_httpsreplace') tests. Note that there will be a pause of 31 seconds with the browser doing nothing, be patient:

        mdk behat -r -t tool_httpsreplace

        • Confirm they now pass
      Show
      Download the attached MDL-70734 .patch file to the moodle site root folder and run the command git apply MDL-70734 .patch in order to apply the following patch: diff --git a/admin/tool/httpsreplace/classes/url_finder.php b/admin/tool/httpsreplace/ classes/url_finder.php index 8dc141616b9..95384e9c5e1 100644 --- a/admin/tool/httpsreplace/classes/url_finder.php +++ b/admin/tool/httpsreplace/classes/url_finder.php @@ -151,6 +151,7 @@ class url_finder { $numberoftables = count($tables); $tablenumber = 0; + sleep(31); foreach ($tables as $table) { if ($progress) { $progress->update($tablenumber, $numberoftables, get_string('searchin g', 'tool_httpsreplace', $table)); Run the httpsreplace ( --tags '@tool_httpsreplace' ) tests. Note that there will be a pause of 31 seconds with the browser doing nothing, be patient: mdk behat -r -t tool_httpsreplace Confirm they now pass
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE, MOODLE_39_STABLE
    • Pull 3.9 Branch:
    • Pull 3.10 Branch:
      MDL-70734-310
    • Pull 3.11 Branch:
      MDL-70734-311
    • Pull Master Branch:
      MDL-70734-master

      Description

      This is a sister of MDL-70014 and maybe the same solution will fix both.

      In any case, this has started to happen immediately after switching to the w3c webdrivers and it was not happening before, so maybe deserves a little bit of research to confirm why that's happening. That's the reason to create it separate from the linked issue.

      It happens with slow runs (slow databases or super-busy workers). And with it fails, usually there are 2 scenarios involved.

      Link: https://ci.moodle.org/job/W39.03.05%20-%20Behat%20-%20Chrome%20+%20Oracle/146/

      Output:

      001 Scenario: Go to the HTTPS replace report screen. Make sure broken domains are reported. # /var/www/html/admin/tool/httpsreplace/tests/behat/httpsreplace.feature:15
            And I press "Continue"                                                                # /var/www/html/admin/tool/httpsreplace/tests/behat/httpsreplace.feature:18
              Curl error thrown for http POST to /session/77c3b7197af10c36eebebba7650a34fc/element/38fc55ab-deb0-4e28-b941-f2cf1746c3a2/click
              
              Operation timed out after 30001 milliseconds with 0 bytes received (Facebook\WebDriver\Exception\WebDriverCurlException)
       
      002 Scenario: Use the find and replace tool. # /var/www/html/admin/tool/httpsreplace/tests/behat/httpsreplace.feature:22
            And I press "Continue"                 # /var/www/html/admin/tool/httpsreplace/tests/behat/httpsreplace.feature:25
              Curl error thrown for http POST to /session/ea0da79318551585f3a26ce8fd0b7822/element/c1fa3f4d-3e69-4f3b-a402-9df04bea1e81/click
              
              Operation timed out after 30001 milliseconds with 0 bytes received (Facebook\WebDriver\Exception\WebDriverCurlException)
       
      2 scenarios (2 failed)
      17 steps (10 passed, 2 failed, 5 skipped)
      1m32.28s (47.18Mb)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Nicols
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Peer reviewer:
              Eloy Lafuente (stronk7)
              Integrator:
              Sara Arjona (@sarjona)
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Mar/21

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 2 hours, 25 minutes
                  1d 2h 25m