Commit 276a1a4
fix(gxt-backend): drain cross-test classic-reactor leaks at fire time
Diagnostic instrumentation (commit 34f9515) confirmed that the
cumulative-state failures in testem CI are driven by leaked classic
reactors crossing test boundaries. Two specific patterns:
- renderLinkToElement (manager.ts:9519) leaks routing-test reactors
whose existing _disconnectedTicks > 4 self-unsub never trips,
because routing tests reattach the same anchor across transitions
and the counter resets each time.
- _renderComponentGxt (renderer.ts:2126) leaks renderComponent
reactors whose self-unsub fix (commit 6ee5180) never trips,
because targetElement is typically #qunit-fixture which stays
connected across tests; testem only clears its children.
Local reproducer (scripts/gxt-test-runner/leak-debug.mjs) showed a
single leaked reactor firing 9,391+ times across unrelated tests.
Fix: tag each reactor at registration with the QUnit test it was
created in. In _fireClassicReactors, reactors whose registeredAtTest
differs from the current test's name are unconditionally invalid
(no real-app reactor legitimately survives a QUnit test boundary)
and we self-unsubscribe before invoking them. Module-init and pre-
QUnit reactors (registeredAtTest === <no-test>) are exempt and
fire normally.
Result on the local cumulative reproducer: 550 leaks intercepted
and drained at the first cross-test fire; reactor population
returns to 0 between tests; the runaway 9,391-fire reactor no
longer exists. Smoke (14 modules / 333 tests) green.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 34f9515 commit 276a1a4
2 files changed
Lines changed: 53 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 145 | + | |
| 146 | + | |
148 | 147 | | |
149 | 148 | | |
150 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
656 | 663 | | |
657 | 664 | | |
658 | 665 | | |
659 | 666 | | |
660 | | - | |
661 | 667 | | |
662 | 668 | | |
663 | 669 | | |
664 | 670 | | |
665 | 671 | | |
| 672 | + | |
666 | 673 | | |
667 | 674 | | |
668 | 675 | | |
| |||
672 | 679 | | |
673 | 680 | | |
674 | 681 | | |
675 | | - | |
| 682 | + | |
676 | 683 | | |
677 | 684 | | |
678 | 685 | | |
679 | 686 | | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
695 | 699 | | |
696 | 700 | | |
697 | 701 | | |
698 | | - | |
699 | | - | |
700 | | - | |
| 702 | + | |
701 | 703 | | |
702 | 704 | | |
703 | 705 | | |
704 | 706 | | |
705 | 707 | | |
706 | | - | |
| 708 | + | |
| 709 | + | |
707 | 710 | | |
708 | 711 | | |
709 | | - | |
| 712 | + | |
710 | 713 | | |
711 | | - | |
712 | | - | |
713 | | - | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
714 | 727 | | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
727 | 732 | | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
728 | 736 | | |
| 737 | + | |
729 | 738 | | |
730 | 739 | | |
731 | 740 | | |
| |||
0 commit comments