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

[webdriver] Close old windows at the end of each test as well as beginning #24879

Merged
merged 2 commits into from Sep 15, 2020

Conversation

stephenmcgruer
Copy link
Contributor

@stephenmcgruer stephenmcgruer commented Aug 4, 2020

Previously, we closed old windows at the start of each test. This was nice in terms
of defensiveness (don't assume the last run left the world in a good state), but made
it hard to find problematic tests that left dialogs open (since they wouldn't throw until
the next test).

Instead, this patch does both - close both at the start and end of a test. This should
improve the blaming situation, whilst still being defensive.

There are potential performance implications to this patch, however test runs are
inconclusive. Full runs of Chrome and Safari show +- 2%, which is possibly within
margin of error. Running locally, some directories showed a ~2% slowdown, whilst
others had little or no difference.

@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24879 August 4, 2020 20:26 Inactive
Copy link
Member

@gsnedders gsnedders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am in favour of landing this, FWIW.

@gsnedders
Copy link
Member

What more do we think this needs before landing? Some performance analysis?

@stephenmcgruer
Copy link
Contributor Author

What more do we think this needs before landing? Some performance analysis?

@jgraham - how do you feel about closing windows both at end and start of test (as this patch does), versus moving closing to end of test only? (Versus the status quo of closing at the start only).

If we're ok with doing both to be as stringent as possible, I can do some performance measurements locally and using trigger runs to see if I can see any clear overhead being introduced. (Locally I can test Chrome, can use trigger runs for Edge and Safari. Firefox doesn't use this path, I believe).

This is a test to determine whether closing old windows at the end of
each test would be useful to find troublesome tests (since the current
behavior results in failures in the *next* test that runs).

Not for submitting in its current form.
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24879 September 13, 2020 16:34 Inactive
@stephenmcgruer
Copy link
Contributor Author

Using a trigger run on Chrome Dev, I can't see any clear difference:

37bb5d4 (this change) - https://community-tc.services.mozilla.com/tasks/groups/LpMYzvFhQ7Kh7x_6mjbZhQ

7bdb28b (parent commit) - https://community-tc.services.mozilla.com/tasks/groups/GkQ6NK7iQkqSeaVVC-5qxA

Each of the chrome-dev jobs seem to be within a minute or two of each other. It seems like with-this change is more often the minute-slower one, but sometimes its the flip.

I've also pushed it to STP trigger as well, since 7bdb28b has a STP run too (https://dev.azure.com/web-platform-tests/wpt/_build/results?buildId=54305&view=results). The trigger run is https://dev.azure.com/web-platform-tests/wpt/_build/results?buildId=54324&view=results, so we'll see in a bit if the numbers are comparable (I suspect STP might be less stable generally?)

@stephenmcgruer
Copy link
Contributor Author

Locally I can see a 2.3% slowdown on fetch/ (~7m7s without, ~7m17s with), and then so far the other directories I've tried have too few tests and any slowdowns are hard to detect. css/ and html/ are way too big and take forever 😆

@jgraham
Copy link
Contributor

jgraham commented Sep 15, 2020

Hmm, a 2% performance regression for a change that's nearly a noop seems pretty bad. But I guess I don't have a strong objection here; ensuring the error is associated with the correct test does seem valuable.

@gsnedders
Copy link
Member

I've also pushed it to STP trigger as well, since 7bdb28b has a STP run too (https://dev.azure.com/web-platform-tests/wpt/_build/results?buildId=54305&view=results). The trigger run is https://dev.azure.com/web-platform-tests/wpt/_build/results?buildId=54324&view=results, so we'll see in a bit if the numbers are comparable (I suspect STP might be less stable generally?)

The STP runs show a ~2.76% speedup, but I have no idea whether that's within the MOE or not.

@stephenmcgruer stephenmcgruer changed the title [WIP] [webdriver] Attempt to close old windows at the end of each test [webdriver] Close old windows at the end of each test as well as beginning Sep 15, 2020
@stephenmcgruer stephenmcgruer marked this pull request as ready for review September 15, 2020 14:15
@wpt-pr-bot wpt-pr-bot added infra wptrunner The automated test runner, commonly called through ./wpt run labels Sep 15, 2020
@stephenmcgruer stephenmcgruer merged commit c35a4f0 into master Sep 15, 2020
@stephenmcgruer stephenmcgruer deleted the smcgruer/close_windows_earlier branch September 15, 2020 15:13
stephenmcgruer added a commit that referenced this pull request Sep 15, 2020
… as beginning (#24879)"

This reverts commit c35a4f0.

Unfortunately this broke the debugging flow of --pause-after-test; the
window is closed at the end of the test so the user can't see the
results or edit/refresh etc.
stephenmcgruer added a commit that referenced this pull request Sep 15, 2020
… as beginning (#24879)" (#25544)

This reverts commit c35a4f0.

Unfortunately this broke the debugging flow of --pause-after-test; the
window is closed at the end of the test so the user can't see the
results or edit/refresh etc.
stephenmcgruer added a commit that referenced this pull request Sep 16, 2020
stephenmcgruer added a commit that referenced this pull request Sep 18, 2020
… as beginning" (#25567)

This is a reland of #24879 (which was reverted in #25544). It updates the code
to only close the windows if the user hasn't asked us to pause after a test has run.

From the original PR:

----

Previously, we closed old windows at the start of each test. This was nice in terms
of defensiveness (don't assume the last run left the world in a good state), but made
it hard to find problematic tests that left dialogs open (since they wouldn't throw until
the next test).

Instead, this patch does both - close both at the start and end of a test. This should
improve the blaming situation, whilst still being defensive.

There are potential performance implications to this patch, however test runs are
inconclusive. Full runs of Chrome and Safari show +- 2%, which is possibly within
margin of error. Running locally, some directories showed a ~2% slowdown, whilst
others had little or no difference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra wptrunner The automated test runner, commonly called through ./wpt run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants