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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try fixing flaky tests in results-view-spec.js #1090

Merged
merged 2 commits into from Jun 12, 2019

Conversation

@as-cii
Copy link
Contributor

commented Jun 12, 2019

Refs atom/atom#19480

This pull request is an attempt at fixing the flaky tests described in the above issue. Such tests were failing in the following way:

ResultsView
  copying path with find-and-replace:copy-path
    it ResultsView copying path with find-and-replace:copy-path copies the selected file path to clipboard
      timeout: timed out after 60000 msec waiting for spec promise to resolve
    it ResultsView copying path with find-and-replace:copy-path copies the selected file path to the clipboard when there are multiple project folders
      timeout: timed out after 60000 msec waiting for spec promise to resolve

After analyzing those two code paths, it seems like the so-called heightInvalidationPromise may be what the tests get stuck on every now and then on CI. That promise is resolved after a resize event occurs, and resize detection is implemented in terms of element-resize-detector.

I noticed that element-resize-detector seems to use setTimeout to report resize events in batches. Given that the default jasmine test runner mocks setTimeout and setInterval, it is possible that a resize event is occurring but element-resize-detector can't report it because of the mocked timer functions.

With these changes, we will avoid mocking setTimeout and setInterval for those two tests to see if it helps improve their flakiness. 馃

Antonio Scandurra added some commits Jun 12, 2019

@as-cii as-cii merged commit 4fa120e into master Jun 12, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@as-cii as-cii deleted the as/fix-test-flakiness branch Jun 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can鈥檛 perform that action at this time.