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

Avoid curl empty replies leading to complete behat run failures

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Modify /index.php to have the following near at the top of the file (just after the <? tag):

        // class s {function __sleep() {serialize($this);}}; serialize(new s());
        

      2. init behat
      3. Run behat over the @mod_chat tag and the --rerun flag
        1. After the first test starts, quickly, uncomment the line above, aka, remove the 2 slashes (//) and save the file.
        2. Observe that one test passed, while the rest failed
      4. Repeat the behat command
        1. Observe that only the failed tests were re-run (1 less than in the previous execution)
      Show
      Modify /index.php to have the following near at the top of the file (just after the <? tag): // class s {function __sleep() {serialize($this);}}; serialize(new s()); init behat Run behat over the @mod_chat tag and the --rerun flag After the first test starts, quickly, uncomment the line above, aka, remove the 2 slashes ( // ) and save the file. Observe that one test passed, while the rest failed Repeat the behat command Observe that only the failed tests were re-run (1 less than in the previous execution)
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull 3.5 Branch:
    • Pull 3.6 Branch:
    • Pull Master Branch:
      MDL-63524-master

      Description

      For some reason, often lately... we are getting, empty responses from the http server running behat tests. Example:

      --- Failed hooks:
       
          BeforeScenario # behat_hooks::before_scenario_hook()
            GuzzleHttp\Exception\ConnectException: cURL error 52: Empty reply from server (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:186
            Stack trace:
            #0 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
            #1 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
            #2 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
            #3 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
            #4 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
            #5 /var/www/html/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(37): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
            #6 /var/www/html/vendor/guzzlehttp/guzzle/src/Middleware.php(36): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
            #7 /var/www/html/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(54): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
            #8 /var/www/html/vendor/guzzlehttp/guzzle/src/Middleware.php(59): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
      ...
      ...
      

      (link: https://ci.moodle.org/job/W35.02.04%20-%20Behat%20-%20Goutte%20+%20MSSQL/85/)

       

      That leads, instead of just re-running the failed scenario... to a complete re-run, so chances of random-failures increase a lot.

      If possible, we should be able to reduce the failures on empty response to the scenario being played, so only that one is re-run, like any other failure.

      Worth checking why we are getting so many of these empty-response errors, they weren't there in the recent past and now they are hitting us basically daily.

      Ciao

        Attachments

        1. MDL-63524-master.png
          MDL-63524-master.png
          67 kB
        2. MDL-63524-36.png
          MDL-63524-36.png
          98 kB
        3. MDL-63524-35.png
          MDL-63524-35.png
          78 kB

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/19

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 1 day, 1 hour, 30 minutes
                1w 1d 1h 30m