Skip to content

[codex] remove avoidable slow test waits - #347

Merged
kamilio merged 1 commit into
mainfrom
codex/speed-up-unit-tests
May 27, 2026
Merged

kamilio merged 1 commit into
mainfrom
codex/speed-up-unit-tests

Conversation

@kamilio

@kamilio kamilio commented May 26, 2026

Copy link
Copy Markdown
Member

What changed

  • Wait for wrapped synchronous command completion before reading its generated exit artifact, rather than polling every 250ms after the wrapper is already done.
  • Add regressions covering both ordinary wrapped sync execution and execution with an inactive cancellation signal.
  • Reuse one prepared Git repository history in clone.integration.test.ts, while copying isolated source/bare repositories per test.

Root cause

  • runPoeCommand read wrapper exit files through a polling API even for synchronous executions whose completed wrapper process guarantees the exit file has been published.
  • The clone integration suite paid real Git init/config/commit/clone setup costs independently in every test.

Impact

  • packages/agent-harness-tools/src/run-poe-command.test.ts test work dropped from approximately 1.78s to 32ms in focused profiling.
  • packages/agent-eval/src/run/clone.integration.test.ts test work dropped from approximately 5.12s to 2.65s in focused profiling.
  • The fixes remove real avoidable latency rather than hiding it behind higher test-runner concurrency.

Validation

  • Demonstrated new no-poll regression fails against the previous behavior by timeout, then passes after the fix.
  • npx vitest run packages/agent-eval/src/run/clone.integration.test.ts packages/agent-harness-tools/src/run-poe-command.test.ts packages/agent-harness-tools/src/log-stream.test.ts --maxWorkers=1 --reporter=dot
  • npm test -w @poe-code/agent-eval
  • npm run build -w @poe-code/agent-eval
  • npm run test:unit -w @poe-code/agent-harness-tools
  • npm run build -w @poe-code/agent-harness-tools
  • npm run lint:eslint
  • npm run lint:types

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@kamilio
kamilio marked this pull request as ready for review May 27, 2026 14:22
@kamilio
kamilio merged commit d21e73a into main May 27, 2026
5 checks passed

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef8f9a5b3f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (aborted) {
return result.value;
}
return waitForExit(toLogStreamEnv(env), jobId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep aborts active while polling for wrapped exits

When a caller supplies an AbortSignal, this branch waits for the wrapper process to finish and then calls waitForExit without any abort signal. If the exit artifact is missing or delayed after handle.result resolves, a later cancellation can no longer interrupt the polling loop, so runPoeCommand can hang indefinitely instead of honoring the caller's abort; the previous implementation kept the exit wait abortable while polling.

Useful? React with 👍 / 👎.

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.

1 participant