Handle shutdown on grid adapters (#5943)
* Handle shutdown on grid adapters * Add tests * Fix postgres test
This commit is contained in:
committed by
Diamond Lewis
parent
f5ac94ddb2
commit
c951e08f63
@@ -96,4 +96,19 @@ describe_only_db('mongo')('GridStoreAdapter', () => {
|
||||
})
|
||||
.catch(fail);
|
||||
});
|
||||
|
||||
it('handleShutdown, close connection', done => {
|
||||
const databaseURI = 'mongodb://localhost:27017/parse';
|
||||
const gridStoreAdapter = new GridStoreAdapter(databaseURI);
|
||||
|
||||
gridStoreAdapter._connect().then(db => {
|
||||
expect(db.serverConfig.connections().length > 0).toEqual(true);
|
||||
expect(db.serverConfig.s.connected).toEqual(true);
|
||||
gridStoreAdapter.handleShutdown().then(() => {
|
||||
expect(db.serverConfig.connections().length > 0).toEqual(false);
|
||||
expect(db.serverConfig.s.connected).toEqual(false);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user