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

Random behat failures with tool_httpsreplace scenarios (timeout)

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MDL-70734-311
    • MDL-70734-master
    • 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

    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

              dobedobedoh Andrew Lyons
              stronk7 Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Janelle Barcega Janelle Barcega
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                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