Repository navigation
test: count paused slot fallbacks without waking lazy objects from other tests - #418
Closed
JuroOravec wants to merge 1 commit into
Closed
JuroOravec wants to merge 1 commit into
JuroOravec wants to merge 1 commit into
Conversation
…her tests Fourteen test_render_body_snapshots cases failed when the citry, citry_ui and citry_lsp test suites ran together under -n 4, and passed alone. Their helper counts paused slot fallbacks by walking gc.get_objects() with isinstance(). isinstance() also reads __class__, and a lazy proxy that another package's tests left alive, Django's staticfiles_storage, answers that by setting itself up, which raises ImproperlyConfigured without static files settings. The helper now compares type(), which reads the real type and leaves proxies alone. The only other gc.get_objects() scan, in test_native_render_rows.py, already uses type(). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
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.
Fourteen
test_render_body_snapshots.pycases fail when the citry, citry_ui and citry_lsp suites run together under-n 4, and pass when run alone. Nothing in Citry's state leaks between packages. The cause is the test's own helper._paused_fallbacks()walksgc.get_objects()and callsisinstance(value, types.GeneratorType)on every live object.isinstance()also reads__class__. Django'sstaticfiles_storageis a lazy proxy that another package's tests left alive, and it answers that read by setting itself up. Without static files settings, the setup raisesImproperlyConfigured:The helper now compares
type(value) is types.GeneratorType, which reads the real type and leaves proxies alone.I checked for the same pattern elsewhere. The only other
gc.get_objects()scan in the repo, intest_native_render_rows.py, already usestype(). No library code walksgcobjects.Evidence: citry, citry_ui and citry_lsp together (
-m "not e2e" -n 4) now pass all 121 snapshot cases. The 4 remaining failures are unrelated:citry_corebuilt from current main (fix: compile and server-render deep Vue templates on any thread #400). My local build is from 5a4e517.typin mismatch.🤖 Generated with Claude Code