Skip to content

test(session-storage): accept the cached kwarg in cotenant_sids forge-safe mocks - #6524

Closed
RohanK6 wants to merge 1 commit into
kirodotdev:mainfrom
RohanK6:fix/session-storage-cotenant-cached-mock
Closed

test(session-storage): accept the cached kwarg in cotenant_sids forge-safe mocks#6524
RohanK6 wants to merge 1 commit into
kirodotdev:mainfrom
RohanK6:fix/session-storage-cotenant-cached-mock

Conversation

@RohanK6

@RohanK6 RohanK6 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

main CI is red on Backend Tests shard 3 (3.10, 3.12, Windows). Two forge-safe test mocks in test/test_session_storage.py (TestCotenantRefusalTextIsForgeSafe, lines ~2504/2524) monkeypatch cotenant_sids with a no-argument lambda, but production now calls cotenant_sids(cached=cached) (the function is def cotenant_sids(*, cached: bool = False)). The code under test therefore raises TypeError: <lambda>() got an unexpected keyword argument 'cached'.

Why it matters

This is a main-side breakage, not specific to one PR: main's own CI fails this job (e.g. run 33159160070 on 16239989d, and the latest on 5c925e4e3), so every PR rebased onto current main inherits a red shard-3 and cannot reach green. A one-PR-blocks-none fix unblocks the whole queue.

What changed (motivation → approach → change)

  • Symptom: TypeError on the cached kwarg in test_move_to_trash_refusal_error_escapes_the_name (and the sibling reclaim_block_reason test), failing shard 3 on all platforms.
  • Root cause: a PR that added the keyword-only cached parameter to cotenant_sids updated the real call sites but missed these two mock lambdas.
  • Change: update both mocks to accept the keyword-only arg, mirroring the real signature: lambda *, cached=False: (frozenset(), self._REFUSALS). Two lines (plus black line-wrapping). No production code touched.

Tests

test/test_session_storage.py::TestCotenantRefusalTextIsForgeSafe passes 2/2 locally with the fix (previously errored on both). black --check clean. No other no-arg cotenant_sids mock lambdas remain in the file.

Related Issues

Fixes #6523

Checklist

  • At most two commits (one), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality — N/A (repairs an existing test's mock; no behavior change)
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable) — N/A
  • No secrets, credentials, or internal references in the diff

@RohanK6
RohanK6 requested a review from a team as a code owner August 28, 2026 11:12
@RohanK6
RohanK6 requested a review from pepmach August 28, 2026 11:12
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 28, 2026
@RohanK6

RohanK6 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #6517 (main commit e48ea42), which fixed the same cotenant_sids forge-safe mock breakage on main. main CI is green again; closing as redundant.

@RohanK6 RohanK6 closed this Aug 28, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main CI red: test_session_storage cotenant_sids mocks reject the new cached kwarg (blocks all PRs)

1 participant