Skip to content

Stop the screenshot tests spending a minute changing view - #700

Merged
goneng merged 2 commits into
masterfrom
reach-the-screenshot-views-by-keyboard
Sep 21, 2026
Merged

goneng merged 2 commits into
masterfrom
reach-the-screenshot-views-by-keyboard

Conversation

@goneng

@goneng goneng commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Reach the history and commit views through the Command-1 and Command-2
key equivalents they already carry, rather than walking the menu bar
through the accessibility hierarchy for tens of seconds a test, and stop
the suite leaving the app on the commit view when it finishes.

  • Drop the menu bar traversal, which dominated two of the tests.
  • Take the view on screen as proof of arrival rather than the click
    landing, and tell the history view apart by the absence of the commit
    view's button, both views carrying tables.
  • Return to the history view before the app is terminated. The commit
    view is remembered in PBShowStageView, testStagingTabScreenshot
    runs last alphabetically and switched to it without switching back, so
    every run left the preference set for whatever launched next.

Test plan

  • make ui-test passes all four tests, and the three screenshots still
    come out with three distinct hashes.
  • With PBShowStageView set beforehand, the suite leaves it clear
    afterwards.
  • On one machine the two navigation-heavy tests fall from 62s and 63s to
    20s and 16s; the suite as a whole from 148s to 69s.

@goneng

goneng commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator Author

Correcting my own description above: the earlier version claimed this fixed the PBGitWindowWiringTests failures on arm64. It does not, and this PR's own run proves it - the same three assertions still fail, at 1.253s and 0.741s, which are not timeouts.

My load diagnosis was wrong. The real cause is PBShowStageView: left set, -changeContentController: never loads the history nib, so commitController stays nil. This PR now also stops the screenshot suite leaking that preference, which is the half I caused. #702 fixes it from the unit-test side; the two are complementary.

@goneng

goneng commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator Author

Predicting this before the run reports, so it is not read as an excuse afterwards: this PR's CI may still be red, and a green would not be evidence either.

Build baseline and run its UI tests (step 198) runs before Run tests (step 260), and the baseline is built from the base commit - master, without this fix. Its screenshot tests still set PBShowStageView, so the wiring tests can still fail here. If the baseline cache hits instead, that step is skipped and the run passes for an unrelated reason.

This only stops the leak at source once it is on master. #702 is the one that unblocks CI now, since it defends the wiring tests whatever set the preference.

Reach the history and commit views through the Command-1 and Command-2
key equivalents they already carry, rather than walking the menu bar
through the accessibility hierarchy for tens of seconds a test.

- Drop the menu bar traversal, which dominated two of the tests: on one
  machine they fall from 62s and 63s to 20s and 16s.
- Take the view on screen as proof of arrival rather than the click
  landing, and tell the history view apart by the absence of the commit
  view's button, both views carrying tables.
Return to the history view before the app is terminated, so that a run
does not decide which view the next launch comes up in.

- PBShowStageView remembers the commit view, and
  testStagingTabScreenshot runs last alphabetically and switched to it
  without ever switching back.
- Do this in tearDown rather than at the end of that test, since a
  failure part-way through skips anything after it, and a failing run is
  exactly when the state must not leak.
@goneng
goneng force-pushed the reach-the-screenshot-views-by-keyboard branch from 8e8299b to 3d2eac4 Compare September 21, 2026 05:25
@hannesa2

Copy link
Copy Markdown
Contributor

Screenshot differs: emulatorApi=arm64 with 2 screenshot(s)

setpoint (old) | diff | actual screenshot (new)

commit-context-menu.pngscreenshot

staging-view.pngscreenshot

@goneng goneng added pipeline CI pipeline and removed test Test related labels Sep 21, 2026
@goneng goneng added test Test related and removed pipeline CI pipeline labels Sep 21, 2026
@goneng
goneng merged commit 5291fc0 into master Sep 21, 2026
3 checks passed
@goneng
goneng deleted the reach-the-screenshot-views-by-keyboard branch September 21, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants