Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destroy test environment when test is done and file syncing switched off (fixes #10) #12

Merged
merged 5 commits into from
Sep 27, 2016
Merged

Conversation

wuzyk
Copy link
Member

@wuzyk wuzyk commented Sep 26, 2016

No description provided.

@@ -210,11 +210,10 @@ module.exports = function createAssert(scope, testCode, settings){

try {
asyncQueue.shift().call();
__processAsync();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you move it to try clause? In that case on call() exception async queue will never be processed and test never be done.

Copy link
Member Author

@wuzyk wuzyk Sep 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On exception test gets done in __exception call in catch block . If call __processAsync() after try/catch clause testDone is called twice.

this.createScope_ = null;
this.scopes.forEach(function(scope){
scope.destroy();
});
this.scopes = null;

if (this.html)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just this.html = null? I think if is redundant here

}
});
fileSync.link(null, function(value){
doneTestCasesAndSuites.source.setSource(value ? null : testsToRun);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source: new Extract({
    source: fileSync.as(function(value){
      return value ? null : testsToRun;
    }),
    rule: function(test){
      return test.parentNode || test;
    }
  }),

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will end up with codestyle error, because doneTestCasesAndSuites defined but not used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use variable then

@@ -24,7 +24,7 @@ function findTest(test, filename){
}
}

function loadTests(data, autorun, notifyLoaderFunction){
function loadTests(data, autorun, fileSync, notifyLoaderFunction){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think new argument should be appended, since notifyLoaderFunction may using by some one.

@lahmatiy lahmatiy merged commit 9ef1c84 into basisjs:master Sep 27, 2016
@wuzyk wuzyk deleted the fix-memory-leakage branch October 3, 2016 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants