fix(e2e): unblock nightly-deploy-moddable cell#204
Merged
Conversation
Three test-infra fixes for the first-night failure on the moddable cell: 1. Drop un-unref'd 30s setTimeout in `connection.ts::timeoutAfter` (and the redundant duplicate in `chain.ts::getTestClient`). The timer was the loser in `Promise.race` after the chain client connected, but stayed pending and kept the event loop alive for ~30s past test completion. The CLI's `scheduleHardExit` papers over it in production; the e2e harness has no equivalent and was hanging past vitest's 5s teardownTimeout, surfacing as `close timed out after 5000ms / Tests closed successfully but something prevents Vite server from exiting`. 2. Make `setupModdableFixture` retry-safe. Probe `gh repo view` before create; if the repo already exists (retry within the same run, or leftover from a crashed prior run), reuse it via origin-add + force-push instead of crashing on "Name already exists". Mirrors the CLI's own "using existing origin (...)" path and lets `nick-fields/retry` actually retry the cell without colliding on the run-scoped repo name. 3. Add `if: always()` cleanup post-step to the workflow that deletes the per-run paritytech/e2e-cli-moddable-<run_id> repo. Runs on success, failure, and cancellation. The weekly e2e-cleanup.yml cron stays as a backstop, but per-run cleanup means retries start clean and we don't accumulate one orphan per failed nightly. Closes #202
Contributor
|
Dev build ready — try this branch: |
Contributor
E2E Test Pass · ✅ PASSTag:
Sentry traces: view spans for this run |
Collaborator
Author
|
Verified the moddable fix via
|
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.
Summary
Three test-infra fixes for the first-night failure on the moddable cell (issue #202). The CLI itself worked correctly on the failing nightly — exit 0, deploy completed, registry stamped. The cell failed because:
nick-fields/retryre-ran the setup; attempt 2'sgh repo create paritytech/e2e-cli-moddable-<run_id>collided with attempt 1's leftover repo ("Name already exists") → real failure.1. Drop the un-unref'd 30 s
setTimeoutthat caused the vitest hangsrc/utils/connection.ts::timeoutAfterand the duplicate ine2e/cli/helpers/chain.ts::getTestClientboth create asetTimeout(..., 30_000)insidePromise.race. WhenconnectPaseo()wins the race, the loser timer is not cancelled — it stays pending and keeps Node's event loop alive until it fires. The CLI'sscheduleHardExit()inprocess-guard.tspapers over this in production; the vitest harness has no equivalent and was hanging past its 5 steardownTimeout, surfacing as:Fix:
.unref()on the timer inconnection.ts. Removes the redundant wrapper inchain.ts(it was layering a second 30 s timeout on top of the one already insidegetConnection()).2. Make
setupModdableFixtureretry-safeProbe
gh repo view paritytech/<repoName>beforegh repo create. If the repo already exists (retry within the same run, or leftover from a crashed earlier run), reuse it:git remote add origin … && git push -u origin main --force. Mirrors what the CLI itself logs on re-run (using existing origin (...)). Force-push is safe — fixture content is identical between attempts.gh auth setup-gitis invoked before the rawgit pushso HTTPS auth viaGH_TOKENflows through gh's credential helper (whichgh repo create --pushdoes implicitly).3. Cleanup post-step in the workflow
if: always() && matrix.cell == 'nightly-deploy-moddable'step that runsgh repo delete paritytech/e2e-cli-moddable-${{ github.run_id }} --yes || trueafter artefacts are uploaded. Runs on success, failure, and cancellation. The weeklye2e-cleanup.ymlcron stays as the backstop, but per-run cleanup means we don't accumulate one orphan per failed nightly.Test plan
pnpm format:check— cleanpnpm lint:license— cleanpnpm build— cleanpnpm test— all unit tests pass (one telemetry test is a known flake under suite-wide contention, passes in isolation)nightly-deploy-moddablecell passes on the first attempt (verified viaworkflow_dispatchtrigger after merge)Closes #202