Add cleanup ordering tests (#237/#238/#241/#242/#243) + sibling-order probe (#244)#11
Merged
Conversation
Translates the cleanup-ordering tests added in alien-signals PR #116 into cross-framework form. Existing suite had no coverage of cleanup ordering contracts (inner-before-outer, sibling LIFO, depth-first reverse on multi-level nesting). - #237 cleanup order on outer re-run: inner before outer, before new run - #238 cleanup order on dispose: inner before outer - #239 sibling cleanup on dispose: reverse creation (LIFO) - #240 sibling cleanup on outer re-run: reverse creation (LIFO) - #241 three-level nested cleanup on dispose: deepest first - #242 effect created in computed: old inner cleanup before new inner setup - #243 cleanup order correct on outer re-run after prior inner-only re-run The computed-unwatched LIFO test from PR #116 is intentionally skipped because auto-disposal of unobserved computeds is not a contract shared across frameworks.
The strict equality assertions over-constrained the tests to
alien-signals's specific model (nested ownership + LIFO siblings).
Frameworks with flat-effect models (no parent-child cascade) failed
not because they have bugs, but because they have a different valid
design.
Changes:
- #237/#238/#241/#242/#243: relax to universal invariants
- outer cleanup must fire and must precede outer re-run
- inner cleanup (if framework cascades) must precede outer cleanup
- frameworks without cascade simply don't fire inner cleanup;
that's accepted
- #239/#240: removed (sibling order is a model choice, not contract)
- Added #244 probe in behaviorDifferences: returns "LIFO" / "FIFO" /
"no cascade" / etc. — characterizing each framework's choice
Remaining failures now reflect real cleanup bugs (e.g. pota not
firing outer cleanup at all) rather than design differences.
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
Translates the cleanup-ordering tests added in alien-signals#116 into cross-framework form. The original strict assertions were too tied to alien-signals's specific model (nested ownership + LIFO siblings); this PR relaxes them to universal invariants and moves model-specific choices to behavioral-difference probes.
Tests added
Main suite (universal invariants — pass for any valid model):
Behavioral probe:
"LIFO"/"FIFO"/"no cascade"/"partial cascade"Dropped from original PR draft:
computed unwatched LIFOtest from PR #116 — not portable (auto-disposal of unobserved computeds isn't shared)Findings
Sibling cleanup probe (#244):
Remaining failures on relaxed tests now indicate real cleanup bugs:
Test plan