Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky Regression Tests #1415

Closed
zcorpan opened this issue May 28, 2020 · 6 comments
Closed

Flaky Regression Tests #1415

zcorpan opened this issue May 28, 2020 · 6 comments
Labels
bug Code defects; not for inaccurate prose regression-testing Related to AVA regression tests of example pages or AVA framework implementation within repo
Milestone

Comments

@zcorpan
Copy link
Member

zcorpan commented May 28, 2020

test/tests/dialog-modal_dialog.js is failing locally but passes in TravisCI

Test: test/tests/dialog-modal_dialog.js
Example tested by this test: examples/dialog-modal/dialog.html

3 tests are failing locally for me in openDialog3 in master branch. They seem to not be failing in Travis CI.

error log
3 tests failed

  dialog-modal_dialog › dialog-modal/dialog.html [data-test-id="key-tab"]: tab changes focus within dialog

  test/tests/dialog-modal_dialog.js:85

   84:   const dialog = (await t.context.queryElements(t, '#dialog3'))[0];
   85:   assert(                                                          
   86:     await dialog.isDisplayed(),                                    

  Rejected promise returned by test. Reason:

  AssertionError {
    actual: false,
    code: 'ERR_ASSERTION',
    expected: true,
    generatedMessage: false,
    operator: '==',
    message: 'dialog3 should have successfullly openned',
  }

  openDialog3 (test/tests/dialog-modal_dialog.js:85:3)
  test/tests/dialog-modal_dialog.js:249:3



  dialog-modal_dialog › dialog-modal/dialog.html [data-test-id="key-shift-tab"]: shift tab changes focus within dialog

  test/tests/dialog-modal_dialog.js:85

   84:   const dialog = (await t.context.queryElements(t, '#dialog3'))[0];
   85:   assert(                                                          
   86:     await dialog.isDisplayed(),                                    

  Rejected promise returned by test. Reason:

  AssertionError {
    actual: false,
    code: 'ERR_ASSERTION',
    expected: true,
    generatedMessage: false,
    operator: '==',
    message: 'dialog3 should have successfullly openned',
  }

  openDialog3 (test/tests/dialog-modal_dialog.js:85:3)
  test/tests/dialog-modal_dialog.js:358:3



  dialog-modal_dialog › dialog-modal/dialog.html [data-test-id="key-escape"]: escape closes dialog

  test/tests/dialog-modal_dialog.js:85

   84:   const dialog = (await t.context.queryElements(t, '#dialog3'))[0];
   85:   assert(                                                          
   86:     await dialog.isDisplayed(),                                    

  Rejected promise returned by test. Reason:

  AssertionError {
    actual: false,
    code: 'ERR_ASSERTION',
    expected: true,
    generatedMessage: false,
    operator: '==',
    message: 'dialog3 should have successfullly openned',
  }

  openDialog3 (test/tests/dialog-modal_dialog.js:85:3)
  test/tests/dialog-modal_dialog.js:439:5

Originally posted by @zcorpan in #1362 (comment)

@spectranaut spectranaut changed the title test/tests/dialog-modal_dialog.js is failing locally but passes in TravisCI Flaky Regression Tests Jul 14, 2020
@jongund
Copy link
Contributor

jongund commented Jul 14, 2020

Problems with my PRs:

@jongund
Copy link
Contributor

jongund commented Jul 20, 2020

@spectranaut
@mcking65
@zcorpan

The regression tests are not reliable on Windows 10, I have discovered this with the menu button examples.
I am not sure what to do, but if anyone is running regression tests on Windows 10, they should get a warning of false positives or that they need to wait for the CI to verify tests have passed, although there seems to be some issues with some menu button tests even in the CI (e.g. aria-expanded being removed). This will make it diffuclt for people developing examples and regression tests in Windows 10. I know I will not be using Windows 10 much for development.

@jongund
Copy link
Contributor

jongund commented Jul 20, 2020

@spectranaut
I fixed some bugs with aria-expanded not being removed and aria-activedescendant not being properly reset when the menu closes on the menu button examples. The regression testing on Windows 10 (flaky as it is) and macOS show all tests passing, for the three examples, but the CI still is generating errors, and the code through inspection appears to be working correctly.

@spectranaut
Copy link
Contributor

Hey @jongund I just spent most of today looking into the flaky menubutton tests in master -- and I'm sorry to say I have not gotten to the bottom of it.. I ran a lot of tests and in the CI (over on the bocoup fork, see here: bocoup#27), there are a few menu button tests that regularly break the build, like 8 out of 10 times. I can't get the tests to fail on my own computer.

I also ran a bunch of tests by forking your branch #1401 with the menubutton changes. When I ran that branch in the CI, even more menu button tests failed in the CI and even more regularly.

For now:

  1. I'm going to open a PR to mark those tests as "failing" until I or someone later can address them. I'll write a comment referencing this issue and we will see the missing tests in th regression report -- I just don't want those failing tests to slow down anyone working on something unrelated.
  2. I would hold off on work on Update menubutton examples: High Contrast Support and APG Coding Practices #1401 until I or someone else can spend time debugging the issue. Probably it would help to do a code review of your changes, although, I looked at the code a bit and definitely nothing stood out. For the most part I was focused on the tests, and trying to pin point where the race conditions are that lead to the failures. I'll ask Matt if I can look into this the next time I have APG time.

@spectranaut
Copy link
Contributor

These are the errors I got running the menubar test in the CI in master (bocoup#27), one or two fails per run:

 not ok 150 - menu-button_actions-active-descendant › menu-button/menu-button-actions-active-descendant.html [data-test-id="menu-up-arrow"]: "up arrow" on role="menu"

  ---

    name: AssertionError

    message: Rejected promise returned by test

    values:

      'Rejected promise returned by test. Reason:': |-

        AssertionError {

          actual: 'mi4',

          code: 'ERR_ASSERTION',

          expected: 'mi3',

          generatedMessage: false,

          operator: 'strictEqual',

          message: 'aria-activedescendant should be set to mi3 for item: #ex1 [role="menu"]',

        }

    at: >-

      assertAriaSelectedAndActivedescendant

      (test/util/assertAriaActivedescendant.js:22:10)

      runMicrotasks (<anonymous>)

      test/tests/menu-button_actions-active-descendant.js:308:5

  ...

not ok 160 - menu-button_actions-active-descendant › menu-button/menu-button-actions-active-descendant.html [data-test-id="menu-up-arrow"]: "up arrow" on role="menu"

  ---

    name: AssertionError

    message: Rejected promise returned by test

    values:

      'Rejected promise returned by test. Reason:': |-

        AssertionError {

          actual: 'mi3',

          code: 'ERR_ASSERTION',

          expected: 'mi2',

          generatedMessage: false,

          operator: 'strictEqual',

          message: 'aria-activedescendant should be set to mi2 for item: #ex1 [role="menu"]',

        }

    at: >-

      assertAriaSelectedAndActivedescendant

      (test/util/assertAriaActivedescendant.js:22:10)

      runMicrotasks (<anonymous>)

      test/tests/menu-button_actions-active-descendant.js:308:5

  ...

not ok 163 - menu-button_actions-active-descendant › menu-button/menu-button-actions-active-descendant.html [data-test-id="menu-character"]: "character" on role="menu"

  ---

    name: AssertionError

    message: Rejected promise returned by test

    values:

      'Rejected promise returned by test. Reason:': |-

        AssertionError {

          actual: 'mi1',

          code: 'ERR_ASSERTION',

          expected: 'mi2',

          generatedMessage: false,

          operator: 'strictEqual',

          message: 'aria-activedescendant should be set to mi2 for item: #ex1 [role="menu"]',

        }

    at: >-

      assertAriaSelectedAndActivedescendant

      (test/util/assertAriaActivedescendant.js:22:10)

      runMicrotasks (<anonymous>)

      test/tests/menu-button_actions-active-descendant.js:383:5

  ...

not ok 154 - menu-button_actions-active-descendant › menu-button/menu-button-actions-active-descendant.html [data-test-id="menu-up-arrow"]: "up arrow" on role="menu"

  ---

    name: AssertionError

    message: Rejected promise returned by test

    values:

      'Rejected promise returned by test. Reason:': |-

        AssertionError {

          actual: 'mi1',

          code: 'ERR_ASSERTION',

          expected: 'mi4',

          generatedMessage: false,

          operator: 'strictEqual',

          message: 'aria-activedescendant should be set to mi4 for item: #ex1 [role="menu"]',

        }

    at: >-

      assertAriaSelectedAndActivedescendant

      (test/util/assertAriaActivedescendant.js:22:10)

      test/tests/menu-button_actions-active-descendant.js:303:3

  ...

not ok 159 - menu-button_actions-active-descendant › menu-button/menu-button-actions-active-descendant.html [data-test-id="menu-down-arrow"]: "down arrow" on role="menu"

  ---

    name: AssertionError

    message: Rejected promise returned by test

    values:

      'Rejected promise returned by test. Reason:': |-

        AssertionError {

          actual: 'mi2',

          code: 'ERR_ASSERTION',

          expected: 'mi3',

          generatedMessage: false,

          operator: 'strictEqual',

          message: 'aria-activedescendant should be set to mi3 for item: #ex1 [role="menu"]',

        }

    at: >-

      assertAriaSelectedAndActivedescendant

      (test/util/assertAriaActivedescendant.js:22:10)

      runMicrotasks (<anonymous>)

      test/tests/menu-button_actions-active-descendant.js:289:5

  ...

not ok 152 - menu-button_actions-active-descendant › menu-button/menu-button-actions-active-descendant.html [data-test-id="menu-up-arrow"]: "up arrow" on role="menu"

  ---

    name: AssertionError

    message: Rejected promise returned by test

    values:

      'Rejected promise returned by test. Reason:': |-

        AssertionError {

          actual: 'mi4',

          code: 'ERR_ASSERTION',

          expected: 'mi3',

          generatedMessage: false,

          operator: 'strictEqual',

          message: 'aria-activedescendant should be set to mi3 for item: #ex1 [role="menu"]',

        }

    at: >-

      assertAriaSelectedAndActivedescendant

      (test/util/assertAriaActivedescendant.js:22:10)

      test/tests/menu-button_actions-active-descendant.js:308:5

  ...

not ok 152 - menu-button_actions-active-descendant › menu-button/menu-button-actions-active-descendant.html [data-test-id="menu-up-arrow"]: "up arrow" on role="menu"

  ---

    name: AssertionError

    message: Rejected promise returned by test

    values:

      'Rejected promise returned by test. Reason:': |-

        AssertionError {

          actual: 'mi4',

          code: 'ERR_ASSERTION',

          expected: 'mi3',

          generatedMessage: false,

          operator: 'strictEqual',

          message: 'aria-activedescendant should be set to mi3 for item: #ex1 [role="menu"]',

        }

    at: >-

      assertAriaSelectedAndActivedescendant

      (test/util/assertAriaActivedescendant.js:22:10)

      test/tests/menu-button_actions-active-descendant.js:308:5

  ...

ot ok 159 - menu-button_actions-active-descendant › menu-button/menu-button-actions-active-descendant.html [data-test-id="menu-down-arrow"]: "down arrow" on role="menu"

  ---

    name: AssertionError

    message: Rejected promise returned by test

    values:

      'Rejected promise returned by test. Reason:': |-

        AssertionError {

          actual: 'mi2',

          code: 'ERR_ASSERTION',

          expected: 'mi3',

          generatedMessage: false,

          operator: 'strictEqual',

          message: 'aria-activedescendant should be set to mi3 for item: #ex1 [role="menu"]',

        }

    at: >-

      assertAriaSelectedAndActivedescendant

      (test/util/assertAriaActivedescendant.js:22:10)

      runMicrotasks (<anonymous>)

      test/tests/menu-button_actions-active-descendant.js:289:5

  ...

not ok 157 - menu-button_actions-active-descendant › menu-button/menu-button-actions-active-descendant.html [data-test-id="menu-character"]: "character" on role="menu"

  ---

    name: AssertionError

    message: Rejected promise returned by test

    values:

      'Rejected promise returned by test. Reason:': |-

        AssertionError {

          actual: 'mi1',

          code: 'ERR_ASSERTION',

          expected: 'mi2',

          generatedMessage: false,

          operator: 'strictEqual',

          message: 'aria-activedescendant should be set to mi2 for item: #ex1 [role="menu"]',

        }

    at: >-

      assertAriaSelectedAndActivedescendant

      (test/util/assertAriaActivedescendant.js:22:10)

      runMicrotasks (<anonymous>)

      test/tests/menu-button_actions-active-descendant.js:383:5

  ...

mcking65 pushed a commit that referenced this issue Aug 9, 2020
Disable a few unreliable regression tests that we don't want to impede other work while we determine the root cause of the inconsistent test behavior.
This change comments out tests that fail most frequently in CI.
The regression test coverage report will report them as missing.
The work to resolve the root issue is tracked by issue #1415.
michael-n-cooper pushed a commit that referenced this issue Aug 9, 2020
Infrastructure: Temporarily comment out flaky tests (pull #1488)

Disable a few unreliable regression tests that we don't want to impede other work while we determine the root cause of the inconsistent test behavior.
This change comments out tests that fail most frequently in CI.
The regression test coverage report will report them as missing.
The work to resolve the root issue is tracked by issue #1415.
@spectranaut
Copy link
Contributor

Fixed a bunch of flaky tests in this PR: #1401 (comment)

@mcking65 mcking65 added bug Code defects; not for inaccurate prose regression-testing Related to AVA regression tests of example pages or AVA framework implementation within repo labels Aug 24, 2020
@mcking65 mcking65 added this to the 1.2 Release 1 milestone Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Code defects; not for inaccurate prose regression-testing Related to AVA regression tests of example pages or AVA framework implementation within repo
Projects
None yet
Development

No branches or pull requests

4 participants