Skip to content

test: restore CI test runtime after dependency-policy regression - #3830

Merged
apcha-oai merged 3 commits into
mainfrom
apcha/ci-test-performance
Sep 9, 2026
Merged

test: restore CI test runtime after dependency-policy regression#3830
apcha-oai merged 3 commits into
mainfrom
apcha/ci-test-performance

Conversation

@apcha-oai

@apcha-oai apcha-oai commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Problem and root cause

Test jobs jumped on August 27 at #3641 (f3f96317e), which added the dependency-security checker and its policy regression matrix. Comparing adjacent main runs:

Python 3.14 Before #3641 After #3641 This PR
Entire test job 2m24s 7m00s 2m41s
Pydantic v2 pytest 60.48s 192.88s 62.75s
Pydantic v1 pytest 46.60s 183.24s 52.60s
Passing tests per v2 run 9,144 11,169 11,306

Before run · After run · This PR

The suites account for 269 of the 276 additional seconds. Large-payload tests were already present while jobs remained around 2m10s; the Steady migration happened afterward. Setup is not the primary cause.

The current security-floor matrix has 1,760 cases. Each previously launched a Python checker and up to four Python Git stubs. This process and compilation overhead repeats under both Pydantic versions in all three test jobs. A representative local profile spent 85ms of 94ms in subprocess calls, with little time in the policy algorithm. A 20-iteration harness comparison measured median 180ms per subprocess case versus 0.9ms in-process.

Change

Compile the same security checker once per pytest worker and execute each policy case with fresh globals, its existing file fixtures, and the same Git stub. Restore patched process state after each execution. Preserve real subprocess execution for CLI parity cases and the existing trusted-base, isolation, and workflow integration tests.

All existing policy cases, SDK coverage, Pydantic lanes, Python versions, large-payload sizes, and production enforcement remain unchanged. Add slow-test reporting to pytest configuration so future regressions are visible.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

36 mixed files remain; 0 existing customizations changed.

Compared 41f0a23177594d81eb7f3dcd. Generated baselines verified.

36 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/openai/init.py
  • src/openai/_client.py
  • src/openai/resources/audio/transcriptions.py
  • src/openai/resources/audio/translations.py
  • src/openai/resources/beta/beta.py
  • src/openai/resources/beta/responses/responses.py
  • src/openai/resources/beta/threads/runs/runs.py
  • src/openai/resources/beta/threads/threads.py
  • src/openai/resources/chat/completions/completions.py
  • src/openai/resources/embeddings.py
  • src/openai/resources/files.py
  • src/openai/resources/realtime/realtime.py
  • src/openai/resources/responses/responses.py
  • src/openai/resources/uploads/uploads.py
  • src/openai/resources/vector_stores/file_batches.py
  • src/openai/resources/vector_stores/files.py
  • src/openai/resources/videos.py
  • src/openai/resources/webhooks/init.py
  • src/openai/resources/webhooks/webhooks.py
  • src/openai/types/chat/init.py
  • src/openai/types/chat/chat_completion_message_tool_call.py
  • src/openai/types/fine_tuning/fine_tuning_job_integration.py
  • src/openai/types/responses/init.py
  • src/openai/types/responses/response.py
  • src/openai/types/responses/response_function_web_search.py
  • src/openai/types/responses/response_function_web_search_param.py
  • src/openai/types/responses/responses_client_event.py
  • src/openai/types/responses/responses_client_event_param.py
  • src/openai/types/responses/tool.py
  • src/openai/types/responses/tool_param.py
  • src/openai/types/webhooks/init.py
  • tests/api_resources/test_videos.py

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 34386625874 --repo openai/openai-python \
  --name castiron-custom-code-34386625874-1 --dir /tmp/castiron-custom-code-34386625874-1
git apply --stat /tmp/castiron-custom-code-34386625874-1/custom-code.patch
cat /tmp/castiron-custom-code-34386625874-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 41f0a2317759e8796ccfbde75536bd42e4aca7a2 4d81eb7f3dcd2e5a6e1a0cf1c74beea6cf724c92
python3 scripts/castiron/custom_code_report.py report \
  --base 41f0a2317759e8796ccfbde75536bd42e4aca7a2 \
  --head 4d81eb7f3dcd2e5a6e1a0cf1c74beea6cf724c92 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-4d81eb7f3dcd
cat /tmp/castiron-custom-code-4d81eb7f3dcd/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@apcha-oai
apcha-oai marked this pull request as ready for review September 9, 2026 17:53
@apcha-oai
apcha-oai requested a review from a team as a code owner September 9, 2026 17:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T17:57:47.879138Z 6dc4ed0 Draft marked ready
🔒 Security Review Completed 2026-09-09T17:55:57.744723Z 6dc4ed0 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openai-sdks

openai-sdks Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

236/236 SDK tests passed in 12.31s for Python SDK PR #3830.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 203ms
tests/chat-completions-create.test.ts ✅ Passed 255ms
tests/chat-completions-stream.test.ts ✅ Passed 275ms
tests/files-content-binary.test.ts ✅ Passed 255ms
tests/files-create-multipart.test.ts ✅ Passed 228ms
tests/files-list-pagination.test.ts ✅ Passed 164ms
tests/initialize-config.test.ts ✅ Passed 297ms
tests/instance-isolation.test.ts ✅ Passed 221ms
tests/models-list.test.ts ✅ Passed 271ms
tests/responses-background-lifecycle.test.ts ✅ Passed 186ms
tests/responses-body-method-errors.test.ts ✅ Passed 392ms
tests/responses-cancel-timeout.test.ts ✅ Passed 266ms
tests/responses-cancel.test.ts ✅ Passed 201ms
tests/responses-compact-retries.test.ts ✅ Passed 380ms
tests/responses-compact.test.ts ✅ Passed 232ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 155ms
tests/responses-create-advanced.test.ts ✅ Passed 235ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.158s
tests/responses-create-errors.test.ts ✅ Passed 230ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 255ms
tests/responses-create-retries.test.ts ✅ Passed 726ms
tests/responses-create-stream-failures.test.ts ✅ Passed 789ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 209ms
tests/responses-create-stream-wire.test.ts ✅ Passed 3.926s
tests/responses-create-stream.test.ts ✅ Passed 103ms
tests/responses-create-terminal-states.test.ts ✅ Passed 309ms
tests/responses-create-timeout.test.ts ✅ Passed 245ms
tests/responses-create.test.ts ✅ Passed 190ms
tests/responses-delete.test.ts ✅ Passed 210ms
tests/responses-input-items-errors.test.ts ✅ Passed 491ms
tests/responses-input-items-list.test.ts ✅ Passed 419ms
tests/responses-input-items-options.test.ts ✅ Passed 375ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 268ms
tests/responses-input-tokens-count.test.ts ✅ Passed 269ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.993s
tests/responses-not-found-errors.test.ts ✅ Passed 299ms
tests/responses-parse.test.ts ✅ Passed 462ms
tests/responses-retrieve-retries.test.ts ✅ Passed 224ms
tests/responses-retrieve.test.ts ✅ Passed 208ms
tests/responses-stored-method-errors.test.ts ✅ Passed 665ms
tests/retry-behavior.test.ts ✅ Passed 3.035s
tests/sdk-error-shape.test.ts ✅ Passed 328ms

View OkTest run #34386192062

SDK merge (3ced9a30cf99) · head (4d81eb7f3dcd) · base (41f0a2317759) · OkTest (08ec4299e769)

@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: 6dc4ed05c0

ℹ️ 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".

Comment thread tests/test_uv_workflows.py
@apcha-oai
apcha-oai enabled auto-merge September 9, 2026 18:05

@jbeckwith-oai jbeckwith-oai 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.

Reviewed exact head 4d81eb7. The test-only refactor preserves fresh per-case globals while caching compilation, and MonkeyPatch restores cwd, environment, subprocess.run, sys.argv, and the Python 3.10 tomllib alias. Real subprocess parity and trusted-base coverage remain in place, production policy code is unchanged, and exact-head Python 3.10/3.14 plus the rest of CI are green.

@apcha-oai
apcha-oai added this pull request to the merge queue Sep 9, 2026

@markstuart-oai markstuart-oai 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.

PR Review Boi: reviewed 4d81eb7 in response to the sdk-reviews request.

Two independent review passes found no actionable correctness or structural issues. Caching compilation while executing fresh checker globals removes the repeated process overhead without duplicating the policy implementation. Both execution paths use the same Git stub, the scoped patches restore process state, and the real CLI parity and trusted-base/stdlib-shadow tests remain in place. The added harness is proportionate to the runtime fix; no production policy or budget changes are introduced.

Validation: 1,141 dependency-security tests passed on Python 3.12.14 (pytest tests/test_uv_workflows.py -k security -n 0); git diff --check passed. The Python 3.10 alias-restoration branch was reviewed statically, not executed locally. Rechecked that the PR remained open and at this head before submitting.

Merged via the queue into main with commit 2d4b97c Sep 9, 2026
28 checks passed
@apcha-oai
apcha-oai deleted the apcha/ci-test-performance branch September 9, 2026 18:14
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.

3 participants