Skip to content

Commit

Permalink
tests: allow special casing for memory tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samccone committed Nov 10, 2015
1 parent 5b02245 commit db74749
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions tests/memory-exceptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"humble": {
"nodes": 30,
"listeners": 0
}
}
5 changes: 3 additions & 2 deletions tests/memory.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var drool = require('drool');
var exceptions = require('./memory-exceptions.json');
var frameworkPathLookup = require('./framework-path-lookup');
var argv = require('optimist').default('laxMode', false).default('browser', 'chrome').argv;
var driverConfig = {
Expand Down Expand Up @@ -81,11 +82,11 @@ list.forEach(function (framework) {
(after.jsHeapSizeUsed - initial.jsHeapSizeUsed) + ', ' + listenerIncrease);

//https://code.google.com/p/chromium/issues/detail?id=516153
if (nodeIncrease > 5) {
if (nodeIncrease > exceptions[framework.name].nodes || 0) {
throw new Error('Node Count leak detected!');
}

if (listenerIncrease > 0) {
if (listenerIncrease > exceptions[framework.name].listeners || 0) {
throw new Error('Event Listener leak detected!');
}

Expand Down

0 comments on commit db74749

Please sign in to comment.