test(session-storage): accept the cached kwarg in cotenant_sids forge-safe mocks - #6524
Closed
RohanK6 wants to merge 1 commit into
Closed
test(session-storage): accept the cached kwarg in cotenant_sids forge-safe mocks#6524RohanK6 wants to merge 1 commit into
RohanK6 wants to merge 1 commit into
Conversation
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem / Motivation
mainCI is red on Backend Tests shard 3 (3.10, 3.12, Windows). Two forge-safe test mocks intest/test_session_storage.py(TestCotenantRefusalTextIsForgeSafe, lines ~2504/2524) monkeypatchcotenant_sidswith a no-argument lambda, but production now callscotenant_sids(cached=cached)(the function isdef cotenant_sids(*, cached: bool = False)). The code under test therefore raisesTypeError: <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 on16239989d, and the latest on5c925e4e3), 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)
TypeErroron thecachedkwarg intest_move_to_trash_refusal_error_escapes_the_name(and the siblingreclaim_block_reasontest), failing shard 3 on all platforms.cachedparameter tocotenant_sidsupdated the real call sites but missed these two mock lambdas.lambda *, cached=False: (frozenset(), self._REFUSALS). Two lines (plus black line-wrapping). No production code touched.Tests
test/test_session_storage.py::TestCotenantRefusalTextIsForgeSafepasses 2/2 locally with the fix (previously errored on both).black --checkclean. No other no-argcotenant_sidsmock lambdas remain in the file.Related Issues
Fixes #6523
Checklist