Skip to content

Inject the schema fault where get_progress gets its connection - #11610

Merged
danielhanchen merged 2 commits into
mainfrom
fix/lease-compat-test-injects-at-connect
Sep 22, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
fix/lease-compat-test-injects-at-connect

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

test_a_real_no_such_column_error_is_not_swallowed fails whenever it does not run straight after the tests above it in studio/backend/tests/test_chat_generation_lease_compat.py. It failed in the Python 3.13 a-k shard under xdist:

FAILED tests/test_chat_generation_lease_compat.py::test_a_real_no_such_column_error_is_not_swallowed - Failed: DID NOT RAISE OperationalError

On main, pytest -k no_such_column fails 1/1 every time. The full file passes only because of the order its tests run in.

Cause

The test wraps runs_db.get_connection in a fake connection that raises no such column: some_other_column, then expects get_progress to let that error through. #11525 made _connect() reuse the thread's pooled connection without calling get_connection at all, and the create_run inside _seed() has just pooled one. So get_progress never reached the fake, and nothing raised.

test run alone
d4a402b57~1 (before #11525) passes
d4a402b57 (#11525) and main fails

The product is right. get_progress still re-raises any no such column that does not name a lease column. The test's fault injection went stale.

Change

The fault is now injected at runs_db._connect, the handle get_progress actually uses, so the test works whether or not a pooled connection exists. The other two injections in this file (_Racy, _Locked) are unaffected. Both rebind runs_db._schema_ready first, which invalidates the pooled entry and sends the call back through get_connection.

Verification

  • The test alone: 1 passed. The full file: 47 passed, also with -n 4.
  • Sabotage: making get_progress swallow every OperationalError fails the test, both alone and in the full file (DID NOT RAISE OperationalError).

Since #11525 a warm thread reuses its pooled connection without calling
get_connection. _seed() pools one, so the fault the no-such-column test
wrapped around get_connection was never reached when the test ran on its
own, and it passed only when an earlier test left the pool unusable.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 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-22T22:39:23.404514Z 1b04b72 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 1b04b72558

ℹ️ 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 727b033 into main Sep 22, 2026
3 of 43 checks passed
@danielhanchen
danielhanchen deleted the fix/lease-compat-test-injects-at-connect branch September 22, 2026 23:34
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…thai#11610)

* Inject the schema fault where get_progress gets its connection

Since unslothai#11525 a warm thread reuses its pooled connection without calling
get_connection. _seed() pools one, so the fault the no-such-column test
wrapped around get_connection was never reached when the test ran on its
own, and it passed only when an earlier test left the pool unusable.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant