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

Behat tests never use profile_guided_allocate

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Define a timing file by defining BEHAT_FEATURE_TIMING_FILE in config.php
      2. Run some behat tests in a parallel run (e.g. /admin/tool/behat/cli/init -j=3 then admin/tool/behat/run.php)
        • Note the timings for each thread
      3. Run the tests again
        • You should see a histogram displaying the allocation of features to each thread.
        • Compare the timings for each thread to the first run. They should be more evenly distributed than before.
      Show
      Define a timing file by defining BEHAT_FEATURE_TIMING_FILE in config.php Run some behat tests in a parallel run (e.g. /admin/tool/behat/cli/init -j=3 then admin/tool/behat/run.php ) Note the timings for each thread Run the tests again You should see a histogram displaying the allocation of features to each thread. Compare the timings for each thread to the first run. They should be more evenly distributed than before.
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Pull Master Branch:
      MDL-62408_master

      Description

      The profile_guided_allocate function which is supposed to divide behat tests into even-sized buckets for parallel runs is never used. The function starts with:

      if (defined('PHPUNIT_TEST')) {
        return false;
      }

      but this should be

      if (defined('PHPUNIT_TEST') && PHPUNIT_TEST) {
        return false;
      }

      since the constant is defined even when running a behat test (but defined as false). This means step or timing files are never used, limiting the benefit of parallel runs.

        Attachments

          Activity

            People

            • Assignee:
              marxjohnson Mark Johnson
              Reporter:
              marxjohnson Mark Johnson
              Peer reviewer:
              Andrew Nicols
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Jul/18