test(agents-core): stabilize leak detection harness#1169
Draft
wsk-builds wants to merge 1 commit intoopenai:mainfrom
Draft
test(agents-core): stabilize leak detection harness#1169wsk-builds wants to merge 1 commit intoopenai:mainfrom
wsk-builds wants to merge 1 commit intoopenai:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 27750bd The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
This pull request fixes the flaky leak-detection harness used by
packages/agents-core/test/result.test.ts.The previous regression checks spawned separate Node processes and asserted on stdout, which made the harness brittle under coverage and worker execution. This change keeps the manual scripts runnable from the CLI, but refactors them into importable helpers with structured results so the Vitest suite can assert directly.
It also adds a shared
gcRuntimetest helper that lazily exposesgcinside the worker when Node was not launched with--expose-gc, and adds the required patch changeset for@openai/agents-core.Validation notes:
pnpm vitest run packages/agents-core/test/result.test.ts --reporter=dotpnpm vitest run packages/agents-core/test/result.test.ts --coverage --reporter=dotnode --expose-gc --import tsx packages/agents-core/test/manual/streamedRunResultLeakCheck.tsnode --expose-gc --import tsx packages/agents-core/test/manual/streamedRunResultLeakStress.tswith the reduced stress env from the testpnpm -F @openai/agents-core build-checkpnpm -F @openai/agents-core dist:checkpnpm lintbash .agents/skills/code-change-verification/scripts/run.shstill stops onpackages/agents-core/test/logger.test.ts, which times out during the fullpnpm testrun under load. That test was not changed in this branch.