Opened 8 months ago

Last modified 4 weeks ago

#5149 new change

[emscripten] Verify that unit tests don't leak any objects

Reported by: trev Assignee: tlucas
Priority: P2 Milestone:
Module: Core Keywords:
Cc: oleksandr, tlucas, sergz Blocked By:
Blocking: #4122 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description

Background

Now that we do "manual" garbage collection, it's important that we never forget to release object references.

What to change

Verify that by the end of each unit test all objects have been garbage collected. The trivial implementation would be adding a filter/subscription counter - global variables incremented in Filter/Subscription constructor and decremented in the corresponding destructor. At the end of each unit test these counters should have the value zero. A more generic solution would be desirable, maybe by using sandboxed-module to instrument some Emscripten code and track all objects exposed by bindings - question is whether this approach is feasible (normally this kind of instrumentation is done with a special build but we wouldn't want to require a special builds for tests).

Change History (2)

comment:1 Changed 4 weeks ago by oleksandr

  • Cc oleksandr tlucas added
  • Owner set to tlucas

comment:2 Changed 4 weeks ago by sergz

  • Cc sergz added
Note: See TracTickets for help on using tickets.