Skip to content

Handle partial E2E dependency initialization during teardown - #3950

Open
zerogravit1 wants to merge 2 commits into
temporalio:mainfrom
zerogravit1:fix/e2e-lifecycle-cleanup
Open

zerogravit1 wants to merge 2 commits into
temporalio:mainfrom
zerogravit1:fix/e2e-lifecycle-cleanup

Conversation

@zerogravit1

Copy link
Copy Markdown

Description & motivation 💭

Fixes #3915.

E2E teardown currently assumes that all dependencies completed initialization.

If setup fails after some dependencies have been created or started, teardown can
throw while attempting to clean up an uninitialized dependency. This can obscure
the original setup failure and prevent later cleanup, including shutdown of the
Temporal dev server.

This change makes codec server shutdown safe before start and makes UI server
cleanup tolerate partial initialization.

Screenshots (if applicable) 📸

N/A

Design Considerations 🎨

The change is intentionally limited to lifecycle cleanup behavior rather than
changing the overall E2E setup sequence.

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests
  • Unit tests added

Added codec lifecycle coverage for:

  • stopping before the server has started
  • stopping more than once

Also reproduced the partial setup failure by temporarily removing the UI assets.

Before the fix:

  • UI server creation failed
  • teardown threw on an uninitialized dependency
  • Temporal shutdown was skipped
  • the Temporal process remained listening on ports 7233/7234

After the fix:

  • the original UI setup failure remained visible
  • teardown completed without the secondary TypeError
  • Temporal shutdown completed successfully
  • no Temporal process or listeners remained

A clean E2E run also completed successfully.

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

  1. Build the E2E assets normally.

  2. Temporarily move the UI assets:

    mv server/ui/assets server/ui/assets.bak

  3. Run:

    pnpm test:e2e tests/e2e/schedules.spec.ts --project="chromium desktop"

  4. Confirm the original UI build failure is reported without a secondary teardown error.

  5. Confirm no Temporal process remains listening on ports 7233/7234.

  6. Restore the assets.

Checklists

Draft Checklist

Opening as draft for feedback on the cleanup approach.

Issue(s) closed

Fixes #3915

Docs

Any docs updates needed?

No.

@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown

@zerogravit1 is attempting to deploy a commit to the Temporal Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Sep 23, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@zerogravit1
zerogravit1 force-pushed the fix/e2e-lifecycle-cleanup branch from 701634d to 761f8ef Compare September 29, 2026 02:22
@zerogravit1
zerogravit1 marked this pull request as ready for review September 29, 2026 02:27
@zerogravit1
zerogravit1 requested a review from a team as a code owner September 29, 2026 02:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E teardown can leave Temporal dev server running after partial setup failure

3 participants