Skip to content

chore(ci): diagnose open handles in smoketests - #842

Merged
jrvb-rl merged 2 commits into
mainfrom
chore/smoketest-open-handle-diagnostics
Sep 21, 2026
Merged

jrvb-rl merged 2 commits into
mainfrom
chore/smoketest-open-handle-diagnostics

Conversation

@jrvb-rl

@jrvb-rl jrvb-rl commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Description

Enable Jest open-handle diagnostics in the HTTP/1 and HTTP/2 smoketest jobs so the next normal dev/prod runs can identify resources preventing clean shutdown. This only gathers evidence; it does not change SDK cleanup or attempt a leak fix.

Motivation

All four transport jobs in the September 21 dev/prod runs passed their tests but reported a worker that could not exit gracefully and had to be terminated.

Changes

  • Run smoketests with --runInBand --detectOpenHandles instead of --maxWorkers=800%.
  • Print allocation stacks in the existing Actions logs, separately for each transport.
  • Retain failure behavior and the existing 60-minute job timeout; do not add --forceExit or ignore errors.

Jest detection requires serial execution and adds overhead. It can change reproduction of concurrency-sensitive leaks. If a handle remains open, the job may reach its timeout after printing diagnostics. This is diagnostic configuration to revisit after collecting evidence, not a permanent leak fix.

Testing

  • Prettier and git diff --check.
  • Smoketest discovery with the diagnostic flags: 28 test files listed without executing live tests.
  • Local synthetic timer-leak test: Jest printed the open-handle type and allocation stack; an external 10-second timeout stopped the deliberately leaking probe as expected.
  • No dev/prod smoketests triggered.

Breaking Changes

None to the SDK API. CI smoketests run serially while diagnostics are enabled.

Checklist

  • Conventional commit title
  • Smoke test workflow updated
  • Diagnostic behavior validated locally

@reflex-loop

reflex-loop Bot commented Sep 21, 2026

Copy link
Copy Markdown

Reflex agent status: Completed

Agent Status
agt_2atOMtgR8vwhUg100l9xQI ✅ Completed

This PR was created by Reflex.

This comment updates in place as agents work.

Comment on lines +82 to +85
- name: Run smoke tests with open-handle diagnostics
# Jest reports allocation stacks for handles preventing clean shutdown.
# Detection runs serially; the job timeout bounds a leaked-handle hang.
run: yarn test:smoke --runInBand --detectOpenHandles --color

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a TODO to remind us to bump up workers again once we've diagnosed the shutdown paths.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a TODO beside the diagnostic command to restore --maxWorkers=800% and remove serial open-handle diagnostics once the shutdown paths have been diagnosed.

@jrvb-rl
jrvb-rl marked this pull request as ready for review September 21, 2026 23:50
@jrvb-rl
jrvb-rl requested a review from jason-rl September 21, 2026 23:50
@jrvb-rl
jrvb-rl merged commit dd96dbd into main Sep 21, 2026
8 checks passed
@jrvb-rl
jrvb-rl deleted the chore/smoketest-open-handle-diagnostics branch September 21, 2026 23:51
@tode-rl tode-rl mentioned this pull request Sep 21, 2026
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.

2 participants