proposal-signals icon indicating copy to clipboard operation
proposal-signals copied to clipboard

Add GC tests

Open robbiespeed opened this issue 4 months ago • 1 comments

This adds 3 new tests, 2 of which currently fail:

  • collects out of scope consumers (✅): Ensures abandoned Computed's (not consumed by anything, and no references) won't cause a memory leak.
  • collects inactive dynamic sources (❌): Ensures old dynamic sources that get replaced can be collected. Since the consumer isn't dirty some might believe this to be expected.
  • collects inactive dynamic sources after update (❌): Ensures old dynamic sources that get replaced can be collected after a update that could have marked the consumer dirty.

The impacts of the two failing tests are bounded, so it's more of a memory deficiency than a full on leak.

Required updating viteconfig to expose gc, doesn't appear to work inside the default pool type. Also WeakRef wasn't usable in spec files, hence adding the nested tsconfig. Doing so enforced strict mode on the spec file so a few further updates to the types were made to appease the type checker.

robbiespeed avatar Apr 13 '24 03:04 robbiespeed