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

Fix behat random failure in scenario "Block users from contacting me with Javascript enabled"

XMLWordPrintable

    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • MDL-43951_master
    • Hide
      1. Install or update your behat site
      2. Start phantomjs
      3. Run
        for i in 1 2 3 4 5 ; do vendor/bin/behat --config /whatever/path/to/the/file/you/have/behat.yml --name 'Block users from contacting me with Javascript enabled' ; done
      4. You SHOULD not experience any failure
      1. (Only in 2.6 as it is harder to reproduce it in master, but as it is a random failure you might not experience it). If you want to reproduce the random failure (which could be good) to be 100% sure that your system's resources & setup experiences it before the patch you can:
        • git log --grep MDL-43951 and revert all the patches (I guess only 1 single patch)
        • Start phantomjs again if it was not already started
        • Run
          for i in 1 2 3 4 5 ; do vendor/bin/behat --config /whatever/path/to/the/file/you/have/behat.yml --name 'Block users from contacting me with Javascript enabled' ; done
      2. Forget about it for a while
      3. See the CLI outputs looking for failures, if you don't see failures you are lucky, if you see them you have been able to reproduce it
      Show
      Install or update your behat site Start phantomjs Download phantomjs binaries http://phantomjs.org/download.html /path/to/panthomjs/bin/phantomjs --webdriver=4444 Run for i in 1 2 3 4 5 ; do vendor/bin/behat --config /whatever/path/to/the/file/you/have/behat.yml --name 'Block users from contacting me with Javascript enabled' ; done You SHOULD not experience any failure (Only in 2.6 as it is harder to reproduce it in master, but as it is a random failure you might not experience it). If you want to reproduce the random failure (which could be good) to be 100% sure that your system's resources & setup experiences it before the patch you can: git log --grep MDL-43951 and revert all the patches (I guess only 1 single patch) Start phantomjs again if it was not already started Run for i in 1 2 3 4 5 ; do vendor/bin/behat --config /whatever/path/to/the/file/you/have/behat.yml --name 'Block users from contacting me with Javascript enabled' ; done Forget about it for a while See the CLI outputs looking for failures, if you don't see failures you are lucky, if you see them you have been able to reproduce it

      The problem is that $field->hasAttribute('whatever') (where get_class($field) = NodeElement) is querying selenium with JS enabled and we are experiencing one of the selenium race conditions when AJAX requests are executed, so we are trying to interact with an element that is not in the page because the page was reloaded after running the first select in And I select "Blocked users (1)" from "Message navigation:"

      A fix for this was included in MDL-43738, externalizing it now as we want 100% passes, IIRC this is the unique random failure I've seen in the last 2 weeks

      As a solution for this, we can check that the option exists, but would be better to try & catch it as race conditions will still exists if we just check it that way (it may be after that when the page reload is executed)

            dmonllao David Monllaó
            dmonllao David Monllaó
            Rajesh Taneja Rajesh Taneja
            Marina Glancy Marina Glancy
            Damyon Wiese Damyon Wiese
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.