E2E: automatic teardown polish#7358
Open
phyllis-sy-wu wants to merge 1 commit intopsyw-0421-E2E-improve-cli-log-formatfrom
Open
E2E: automatic teardown polish#7358phyllis-sy-wu wants to merge 1 commit intopsyw-0421-E2E-improve-cli-log-formatfrom
phyllis-sy-wu wants to merge 1 commit intopsyw-0421-E2E-improve-cli-log-formatfrom
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Apr 21, 2026
f5d5cb6 to
c9b80d6
Compare
6534dd1 to
812c23b
Compare
c9b80d6 to
cca6a1f
Compare
812c23b to
054ff0e
Compare
cca6a1f to
aa4b84a
Compare
054ff0e to
948159e
Compare
948159e to
f4d2f79
Compare
aa4b84a to
24cc2d9
Compare
f4d2f79 to
e2f6c6d
Compare
This was referenced Apr 22, 2026
24cc2d9 to
f8430c6
Compare
e2f6c6d to
d892ee8
Compare
d892ee8 to
64ab746
Compare
9ff8224 to
d2b07be
Compare
29dfa72 to
9fdc90b
Compare
d2b07be to
71cf082
Compare
9fdc90b to
9ef5dba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

WHY are these changes introduced?
Improves reliability of per-test teardown. Before these changes, CI runs commonly left 2–3 orphaned stores/apps per full 5-worker run, and a failed click could burn 5–7 minutes in a single phase before the outer attempt gave up.
WHAT is this pull request doing?
Four coordinated fixes in the teardown path. All three "do-the-thing" helpers (
uninstallAppFromStore,deleteStore,deleteAppFromDevDashboard) now own their own retry + verification, andteardown.tsbecomes the orchestrator.1.
deleteAppFromDevDashboard— sync withcleanup-apps.ts:deleteApp(setup/app.ts)Teardown's app-delete helper and the standalone cleanup script had drifted apart; cleanup-apps had absorbed fixes that teardown was missing. Brought them back to parity:
trueimmediately (no URL-change wait).scrollIntoViewIfNeededon the "Delete app" button — it sits below the fold on some viewport sizes.isEnabled()gate instead of the brittlegetAttribute('disabled')check (the latter returns""for<button disabled>, making!isDisabledtruthy — a silent false positive).click({timeout: 2 * BROWSER_TIMEOUT.long})auto-wait handles the rest at ~100ms granularity.DELETEconfirmation input (some modals require typing it).button:has-text("Delete app").last()for the modal confirm.404: Not Found(not a URL-change wait).404 short-circuit — before/after
Before: clicks confirm, then
waitForURL(url !== urlBefore)for up to 60s — if the page never navigates away (e.g. the delete silently succeeded but left us on the same URL), the helper burns the full timeout and returnsfalse.Expand to see code
delete-app-automatic-redirect.mov
After: reloads
{appUrl}/settingsafter confirm — a404: Not Foundbody is the definitive "app is gone" signal, and short-circuits in seconds instead of waiting 60s for a URL change that may never come.Expand to see code
delete-app-force-refresh.mov
2.
deleteStore— full-flow retry with silent-failure detection (setup/store.ts)Before: the function had three independent step-level retries (navigate, checkbox, confirm) that couldn't recover from silent click failures. The admin's "Delete store" confirm button sometimes silently fails and redirects to the store home (
/store/{slug}) instead of/access_account— and the old code would thenwaitForURL(/access_account/)for the full 60s budget before returning false.After: full flow wrapped in an outer 3-attempt retry, each attempt re-navigates to
planUrlat the top (guarantees a clean start — even if the previous attempt landed on store home). Verification matches either URL and returns fast in both cases.Also scopes the modal selector by title (matching
cleanup-stores.ts):…to avoid matching stale/hidden modals left over from previous interactions.
3.
uninstallAppFromStore— always reload before verify (setup/store.ts)The old check-stale-DOM-first pattern could return success before the uninstall propagated. Now unconditional: reload, dismiss Dev Console, then check.
Before:
After:
4.
teardown.ts— orchestrator simplificationWith each helper now owning its own retry + verification, the orchestrator becomes simpler and more targeted:
uninstallAppFromStore.deleteStoreretries internally. Pre-flight check: navigate to/settings/apps, reload once if stale, verify apps are empty before attempting delete.cleanup-apps.tsreaps the orphan instead. If uninstall succeeded, runs 3×findAppOnDevDashboard+deleteAppFromDevDashboard.Combined effect: worst-case teardown time drops from ~20 minutes (3 × 5–7min per phase) to a bounded few minutes per phase, and the "uninstall-fail → waste 5–7min polling a disabled button" failure mode is gone entirely.
Fastest CI run times observed: 6m 32s (shard 1/2) and 4m 50s (shard 2/2).
5. Rename
E2E_SKIP_CLEANUP→E2E_SKIP_TEARDOWNThe env var controls per-test teardown, not the standalone cleanup scripts. Renamed across all 7 test specs for clarity:
How to test your changes?
Checklist
pnpm changeset add