Skip to content

Commit

Permalink
fix: release memory held by a testsuite after we're done with it.
Browse files Browse the repository at this point in the history
As #61 (comment)
Minor cleanup. Doing it this way should be faster though (no constructor call overhead, less code to begin with).

* Release memory held by a testsuite after we're done with it.

When a test finishes and the result has been written out the reference to the testsuite in the suites object can be dropped.
Ideally we'd drop the reference from the array entirely but that involves recreating the array and *that* might race.
So instead we just make the testsuite object point to 'null'.
  • Loading branch information
randakar authored and dignifiedquire committed Dec 6, 2016
1 parent e09acb2 commit eacf8bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ var JUnitReporter = function (baseReporterDecorator, config, logger, helper, for
suite.ele('system-err')

writeXmlForBrowser(browser)

// Release memory held by the test suite.
suites[browser.id] = null
}

// "run_complete" - a test run has completed on all browsers
Expand Down

0 comments on commit eacf8bb

Please sign in to comment.