Skip to content

test(runtime): await usage settlement in rollback isolation test - #2179

Merged
hidb4ai merged 1 commit into
masterfrom
codex/2084-usage-test-budget
Oct 21, 2026
Merged

hidb4ai merged 1 commit into
masterfrom
codex/2084-usage-test-budget

Conversation

@AlexStocks

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Refs #2084 and #2174 (CI follow-up).

Rationale for this change

The Python 3.12 unit job in #2174 failed with IndexError in test_in_memory_usage_does_not_join_outer_rollback, after the recorder reported that its default 500 ms flush observation window expired. A successful best-effort flush() return does not promise that the usage write has settled within that default window.

What changes are included in this PR?

Give this rollback-isolation regression explicit 5 s write and 6 s flush budgets, as the adjacent queue-admission regression already does. Keep the persisted-usage, business-rollback and connection-restoration assertions.

Are there any user-facing changes?

None. Production deadlines, loss behavior and the dedicated timeout tests are unchanged.

How was this change tested?

  • A one-off SQLAlchemy driver probe delays the first usage Scope read by 600 ms: exact master reproduces the same empty-row IndexError; the changed test passes with the same delay.
  • pytest tests/builtin/runtime/test_model_usage_recorder.py -q: 32 passed on Linux/Python 3.11 and 32 passed on Windows/Python 3.14.
  • Changed-file pre-commit/Ruff/format and git diff --check passed.

The driver probe models a delayed healthy driver; it does not establish the hosted runner's exact scheduling cause.

AI usage statement

Codex implemented the test-only change and ran the reported verification.

The rollback-isolation regression assumes the lossy recorder's default 500 ms flush has settled its usage write. A healthy but delayed driver can outlive that observation window, producing an empty row read in Python 3.12 CI. Give this non-timing regression explicit 5 s write and 6 s flush budgets.

Constraint: retain all statistics, rollback and connection-restoration assertions; production timing and the dedicated timeout tests stay unchanged.
Scope-risk: test-only budget change.
Tested: a 600 ms SQL driver pause reproduces the exact IndexError on master and passes after the change; all 32 recorder tests pass on Linux and Windows; Ruff and changed-file pre-commit checks pass.
@AlexStocks
AlexStocks requested a review from PsiACE as a code owner October 21, 2026 13:58
Copilot AI balanced review requested due to automatic review settings October 21, 2026 13:58

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@hidb4ai hidb4ai 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

@hidb4ai
hidb4ai merged commit e066d5f into master Oct 21, 2026
48 checks passed
@hidb4ai hidb4ai added the 1.4.1 v1.4.1 release tracking label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.4.1 v1.4.1 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants