atlas2 icon indicating copy to clipboard operation
atlas2 copied to clipboard

Tests leak something

Open cdaniel opened this issue 8 years ago • 1 comments
trafficstars

Mocha has changed behaviour, and right now it does not quit by default after iterating through all tests, but waits for the process (processes) to exit naturally. It does not happen for my tests.

I had to add --quit flag to mocha as a workaround.

Any help with this is welcome.

cdaniel avatar Oct 11 '17 19:10 cdaniel

After initial investigation - it is necessary to shut down the entire stack in appropriate way. Things one have to remember can be summarised in this snippet:

    after(function(done) {
      app.___imageRendererModule.shutdown()
        .then(function() {
          app.___conn.db.dropDatabase(function() {
            app.___conn.close(function() {
              app.close(function() {
                done();
              });
            });
          });
        });
    });

But messing with connections borks the model (Workspace, WardleyMap, Node). I have to review how the connection is passed to the model, and ensure tests are trully independent. It will help the main app, too.

cdaniel avatar Oct 18 '17 14:10 cdaniel