e2e: Retry transient theme activation failures in pages spec#79171
Conversation
The 'pages' site-editor spec intermittently fails in CI when its beforeAll/afterAll hooks activate a theme, with an 'apiRequestContext.get: socket hang up' (ECONNRESET) error. This is a transient connection drop, not a real failure. Wrap the activateTheme() calls in a small retry helper that retries only on the socket hang up / ECONNRESET error and rethrows any other error immediately, so genuine failures still surface. Fixes #74483
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 8.59 MB |
|
Flaky tests detected in cf49c0d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27464950672
|
What?
Fixes the flaky
pagessite-editor e2e test reported in #74483.Why?
The test itself isn't the problem — it intermittently fails in its
beforeAll/afterAllhooks while activating a theme:socket hang upis a NodeECONNRESET— the server occasionally drops the connection under CI load.activateThemeissues rawrequest.get()calls with no retry, so a single dropped connection fails the wholedescribe.How?
Wrap the
activateTheme()calls in the spec's hooks with a small local retry helper. It retries only on the transientsocket hang up/ECONNRESETerror (up to 3 attempts) and rethrows any other error immediately, so genuine failures (e.g. a missing theme) still surface right away.The fix is intentionally scoped to this spec rather than the shared
themes.tsutil.Testing Instructions
npm run test:e2e -- test/e2e/specs/site-editor/pages.spec.jsand confirm it passes.Fixes #74483