Skip to content

Commit 5bb5b90

Browse files
committed
fix(CI) Speculative fix for intermittent Travis CI fail. From https://stackoverflow.com/questions/30909492/mongoerror-topology-was-destroyed
1 parent 17750c6 commit 5bb5b90

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/api/ControlAPISpec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ describe('original API', function () {
1919

2020
fng = new (formsAngular)(mongoose, app, {urlPrefix: '/api/'});
2121

22-
mongoose.connect('mongodb://localhost/forms-ng_test', {useMongoClient: true});
22+
mongoose.connect('mongodb://localhost/forms-ng_test', {
23+
useMongoClient: true,
24+
server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
25+
replset: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
26+
options: { keepAlive: 1, connectTimeoutMS: 30000, reconnectTries: 30, reconnectInterval: 5000 }
27+
});
2328
mongoose.connection.on('error', function () {
2429
console.error('connection error', arguments);
2530
});

0 commit comments

Comments
 (0)