Skip to content

Tests: the image switch guard follows the load-tail wait from #18626 - #18657

Merged
danielhanchen merged 1 commit into
mainfrom
ci/images-switch-test-follows-load-tail
Nov 20, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/images-switch-test-follows-load-tail

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Frontend unit tests fail on main (seen on #18522, reproduced on current main):

not ok - the backend refuses an image generate while a load is in flight
  location: studio/frontend/tests/images-generate-during-switch.test.ts:77
  The input did not match the regular expression /if await asyncio\.to_thread\(_image_load_in_flight\):\s*raise HTTPException\(\s*status_code = 409/

Cause

#18420 added this source check: a generate that arrives while a model load is in flight was refused straight away with 409. Then #18626 deliberately changed that branch in routes/inference.py:

  • a generate during a load whose pipeline is already published now waits out the load's tail (encoder pins);
  • a generate that cannot wait (pipeline not published yet, or the tail outlasts the cap) is still refused with the in-flight 409.

#18626 covered the new behaviour with backend tests (test_images_generate_load_tail.py), but this frontend check still expected the 409 on the line right after the if. The product change is right; the check is out of date.

Change

images-generate-during-switch.test.ts now asserts the invariant both PRs share, that no image run starts while a load is in flight. It finds the in-flight branch before a run is admitted and requires both:

  • that it waits out the tail (await _wait_image_load_tail();
  • that it still raises HTTPException(status_code = 409, detail = IMAGE_LOAD_IN_FLIGHT_MSG) when it cannot.

Testing

  • On main the file fails 1 of 7. With this change: 7 passed.
  • Sabotage on routes/inference.py, each of which fails the new check:
    • removing the in-flight 409;
    • replacing the tail wait.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T18:24:40.411702Z c594641 Manual request
ℹ️ 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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: c594641267

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

@danielhanchen
danielhanchen merged commit 715fd64 into main Nov 20, 2026
@danielhanchen
danielhanchen deleted the ci/images-switch-test-follows-load-tail branch November 20, 2026 18:25
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