Commit 6deded4
fix(gxt-backend): drain leaked classic reactors at testDone, not at fire time
Diagnostic instrumentation (commit 34f9515) confirmed two leak paths:
- renderLinkToElement (manager.ts:9519) reactors leak across tests
because the existing _disconnectedTicks > 4 self-unsub never trips:
routing tests reattach the same anchor across transitions, resetting
the counter.
- _renderComponentGxt (renderer.ts:2126) reactors leak because the
self-unsub fix (commit 6ee5180) never trips — targetElement is
usually #qunit-fixture which stays connected across tests; testem
only clears its children.
Local cumulative reproducer showed a single leaked reactor firing
9,391+ times across unrelated tests.
Previous attempt (commit 276a1a4, reverted): drop reactors at
fire time when registeredAtTest != currentTest. That regressed
~700 CI tests because Ember's classic reactivity can fire reactors
during transient states (afterEach destruction, router setup) where
QUnit.config.current is briefly inconsistent with the test that
owns the work.
This fix: tag each reactor at registration with the QUnit test name,
then drain that test's reactors in BULK at testDone — when the test
is fully torn down, no reactor of that test is needed in any later
test, regardless of QUnit.config.current's instantaneous value.
Module-init reactors (registeredAtTest === <no-test>) are exempt.
Local validation: 150 DRAIN events at testDone boundaries, each
returning the reactor population to 0; 0 cross-test LEAK fires
observed in the diagnostic snapshot. Smoke (14 modules / 333 tests)
green.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 6699443 commit 6deded4
2 files changed
Lines changed: 83 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
104 | 122 | | |
105 | | - | |
| 123 | + | |
| 124 | + | |
106 | 125 | | |
107 | 126 | | |
108 | 127 | | |
| |||
| 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 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
656 | 671 | | |
657 | 672 | | |
658 | 673 | | |
659 | 674 | | |
660 | | - | |
661 | 675 | | |
662 | 676 | | |
663 | 677 | | |
664 | 678 | | |
665 | 679 | | |
| 680 | + | |
666 | 681 | | |
667 | 682 | | |
668 | 683 | | |
| |||
672 | 687 | | |
673 | 688 | | |
674 | 689 | | |
675 | | - | |
| 690 | + | |
676 | 691 | | |
677 | 692 | | |
678 | 693 | | |
679 | 694 | | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
695 | 707 | | |
696 | 708 | | |
697 | 709 | | |
698 | | - | |
699 | | - | |
700 | | - | |
| 710 | + | |
701 | 711 | | |
702 | 712 | | |
703 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
704 | 740 | | |
705 | 741 | | |
706 | 742 | | |
| |||
712 | 748 | | |
713 | 749 | | |
714 | 750 | | |
715 | | - | |
716 | | - | |
717 | 751 | | |
718 | | - | |
719 | | - | |
| 752 | + | |
| 753 | + | |
720 | 754 | | |
721 | 755 | | |
722 | 756 | | |
| |||
0 commit comments