fix(PrizePool): isolate team template mock per test#7795
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR stabilizes the PrizePool spec by ensuring the TeamTemplate extension is consistently mocked in every test, preventing order-dependent failures introduced by memoization of TeamTemplate.getRawOrNil.
Changes:
- Add a module-level
TeamTemplateMockrequire and set it up inbefore_each. - Tear down the
TeamTemplatemock inafter_eachto avoid cross-test leakage. - Remove redundant per-test mock setup/teardown from the “USD player share” test.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mbergen
approved these changes
Jul 9, 2026
Rathoz
approved these changes
Jul 9, 2026
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.
Summary
TeamTemplatemock inbefore_each/after_eachso every test in the spec resolves team templates against mock dataTeamTemplate.getRawOrNilis memoized at module scope (perf: Memoize TeamTemplate.getRawOrNil #7777), so a team resolved while the mock was inactive cached anilresult that leaked into the later "USD player share" test, trippingInvalid team template: mouzHow did you test this change?
CI