Skip to content

Commit 28b56fe

Browse files
committed
Lots of minor fixes to deal with changes in 3.1.x that makes wired tiger default
1 parent 2d35aaa commit 28b56fe

File tree

9 files changed

+182
-225
lines changed

9 files changed

+182
-225
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"legacy"
1414
],
1515
"dependencies": {
16-
"mongodb-core": "1.2.2"
16+
"mongodb-core": "1.2.3"
1717
, "readable-stream": "1.0.31"
1818
, "es6-promise": "2.1.1"
1919
},

test/functional/collection_tests.js

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -855,50 +855,6 @@ exports['Should correctly execute update with elemMatch field in selector'] = {
855855
}
856856
}
857857

858-
/**
859-
* @ignore
860-
*/
861-
exports['Should correctly execute find with elemMatch field in selector'] = {
862-
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
863-
864-
// The actual test we wish to run
865-
test: function(configuration, test) {
866-
var ObjectID = configuration.require.ObjectID;
867-
868-
var db = configuration.newDbInstance(configuration.writeConcernMax(), {poolSize:1});
869-
db.open(function(err, db) {
870-
db.collection('executeUpdateWithElemMatch').findOne({item: {$elemMatch: {name: 'my_name'}}}, function(err, result, full) {
871-
test.equal(null, err);
872-
873-
db.close();
874-
test.done();
875-
});
876-
});
877-
}
878-
}
879-
880-
/**
881-
* @ignore
882-
*/
883-
exports['Should correctly execute remove with elemMatch field in selector'] = {
884-
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
885-
886-
// The actual test we wish to run
887-
test: function(configuration, test) {
888-
var ObjectID = configuration.require.ObjectID;
889-
890-
var db = configuration.newDbInstance(configuration.writeConcernMax(), {poolSize:1});
891-
db.open(function(err, db) {
892-
db.collection('executeUpdateWithElemMatch').remove({item: {$elemMatch: {name: 'my_name'}}}, function(err, result, full) {
893-
test.equal(null, err);
894-
895-
db.close();
896-
test.done();
897-
});
898-
});
899-
}
900-
}
901-
902858
/**
903859
* @ignore
904860
*/
@@ -1033,7 +989,6 @@ exports['Should correctly list multipleCollections'] = {
1033989
test.ok(names['test1'] != null);
1034990
test.ok(names['test2'] != null);
1035991
test.ok(names['test3'] != null);
1036-
test.ok(names['system.indexes'] != null);
1037992

1038993
db.close();
1039994
test.done();

test/functional/cursor_tests.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ exports.shouldHandleWhenLimitBiggerThanBatchSize = {
989989

990990
//4th
991991
cursor.nextObject(function(err, items) {
992-
test.equal(2, cursor.bufferedCount());
992+
test.equal(null, err);
993993

994994
//No more
995995
cursor.nextObject(function(err, items) {
@@ -1466,7 +1466,7 @@ exports.shouldCorrectlyExecuteEnsureIndexWithNoCallback = {
14661466

14671467
// Find with sort
14681468
collection.find().sort(['createdAt', 'asc']).toArray(function(err, items) {
1469-
if (err) logger.error("error in collection_info.find: " + err);
1469+
test.equal(null, err);
14701470
test.equal(1, items.length);
14711471
db.close();
14721472
test.done();
@@ -1504,7 +1504,6 @@ exports['Should correctly execute count on cursor'] = {
15041504

15051505
// insert all docs
15061506
collection.insert(docs, configuration.writeConcernMax(), function(err, result) {
1507-
console.dir(err)
15081507
test.equal(null, err);
15091508
var total = 0;
15101509
// Create a cursor for the content
@@ -1932,7 +1931,7 @@ exports.shouldCloseDeadTailableCursors = {
19321931

19331932
db.open(function(err, db) {
19341933

1935-
var options = { capped: true, size: 8 };
1934+
var options = { capped: true, size: 10000000 };
19361935
db.createCollection('test_if_dead_tailable_cursors_close', options, function(err, collection) {
19371936
test.equal(null, err);
19381937
var closed = false;
@@ -1943,7 +1942,8 @@ exports.shouldCloseDeadTailableCursors = {
19431942
collection.insert({id: i});
19441943
}
19451944

1946-
stream.on('data', function (doc) {});
1945+
stream.on('data', function (doc) {
1946+
});
19471947

19481948
stream.on('error', function (err) {
19491949
test.ok(err != null);

test/functional/db_tests.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
exports.shouldCorrectlyHandleIllegalDbNames = {
77
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
8-
8+
99
// The actual test we wish to run
1010
test: function(configuration, test) {
1111
var Db = configuration.require.Db;
@@ -64,7 +64,7 @@ exports.shouldCorrectlyHandleIllegalDbNames = {
6464
*/
6565
exports.shouldCorrectlyPerformAutomaticConnect = {
6666
metadata: { requires: { topology: 'single' } },
67-
67+
6868
// The actual test we wish to run
6969
test: function(configuration, test) {
7070
var automatic_connect_client = configuration.newDbInstance(configuration.writeConcernMax(), {poolSize:1, auto_reconnect:true});
@@ -100,7 +100,7 @@ exports.shouldCorrectlyPerformAutomaticConnect = {
100100
*/
101101
exports.shouldCorrectlyPerformAutomaticConnectWithMaxBufferSize0 = {
102102
metadata: { requires: { topology: 'single' } },
103-
103+
104104
// The actual test we wish to run
105105
test: function(configuration, test) {
106106
var automatic_connect_client = configuration.newDbInstance({w:1, bufferMaxEntries:0}, {poolSize:1, auto_reconnect:true});
@@ -132,7 +132,7 @@ exports.shouldCorrectlyPerformAutomaticConnectWithMaxBufferSize0 = {
132132
*/
133133
exports.shouldCorrectlyHandleFailedConnection = {
134134
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
135-
135+
136136
// The actual test we wish to run
137137
test: function(configuration, test) {
138138
var Db = configuration.require.Db
@@ -150,7 +150,7 @@ exports.shouldCorrectlyHandleFailedConnection = {
150150
*/
151151
exports.shouldCorrectlyResaveDBRef = {
152152
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
153-
153+
154154
// The actual test we wish to run
155155
test: function(configuration, test) {
156156
var DBRef = configuration.require.DBRef;
@@ -203,7 +203,7 @@ exports.shouldCorrectlyForceReindexOnCollection = {
203203
metadata: {
204204
requires: { topology: ["single", "replicaset"] }
205205
},
206-
206+
207207
// The actual test we wish to run
208208
test: function(configuration, test) {
209209
var db = configuration.newDbInstance(configuration.writeConcernMax(), {poolSize:1, auto_reconnect:false});
@@ -253,7 +253,7 @@ exports.shouldCorrectlyForceReindexOnCollection = {
253253
*/
254254
exports.shouldCorrectlyGetErrorDroppingNonExistingDb = {
255255
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
256-
256+
257257
// The actual test we wish to run
258258
test: function(configuration, test) {
259259
var db = configuration.newDbInstance(configuration.writeConcernMax(), {poolSize:1, auto_reconnect:false});
@@ -278,7 +278,7 @@ exports.shouldCorrectlyGetErrorDroppingNonExistingDb = {
278278
*/
279279
exports.shouldCorrectlyThrowWhenTryingToReOpenConnection = {
280280
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
281-
281+
282282
// The actual test we wish to run
283283
test: function(configuration, test) {
284284
var db = configuration.newDbInstance(configuration.writeConcernMax(), {poolSize:1, auto_reconnect:false});
@@ -302,7 +302,7 @@ exports.shouldCorrectlyThrowWhenTryingToReOpenConnection = {
302302
*/
303303
exports.shouldCorrectlyReconnectWhenError = {
304304
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
305-
305+
306306
// The actual test we wish to run
307307
test: function(configuration, test) {
308308
var Db = configuration.require.Db
@@ -328,7 +328,7 @@ exports.shouldCorrectlyReconnectWhenError = {
328328
*/
329329
exports.shouldCorrectlyUseCursorWithListCollectionsCommand = {
330330
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
331-
331+
332332
// The actual test we wish to run
333333
test: function(configuration, test) {
334334
var Db = configuration.require.Db
@@ -349,7 +349,7 @@ exports.shouldCorrectlyUseCursorWithListCollectionsCommand = {
349349
// Create a collection
350350
db1.collection('test1').insertOne({a:1}, function() {
351351
test.equal(null, err);
352-
352+
353353
// Get listCollections filtering out the name
354354
var cursor = db1.listCollections({name: 'test1'});
355355
cursor.toArray(function(err, names) {
@@ -370,7 +370,7 @@ exports.shouldCorrectlyUseCursorWithListCollectionsCommand = {
370370
*/
371371
exports.shouldCorrectlyUseCursorWithListCollectionsCommandAndBatchSize = {
372372
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
373-
373+
374374
// The actual test we wish to run
375375
test: function(configuration, test) {
376376
var Db = configuration.require.Db
@@ -391,7 +391,7 @@ exports.shouldCorrectlyUseCursorWithListCollectionsCommandAndBatchSize = {
391391
// Create a collection
392392
db1.collection('test1').insertOne({a:1}, function() {
393393
test.equal(null, err);
394-
394+
395395
// Get listCollections filtering out the name
396396
var cursor = db1.listCollections({name: 'test'}, {batchSize:1});
397397
cursor.toArray(function(err, names) {
@@ -412,7 +412,7 @@ exports.shouldCorrectlyUseCursorWithListCollectionsCommandAndBatchSize = {
412412
*/
413413
exports['should correctly list collection names with . in the middle'] = {
414414
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
415-
415+
416416
// The actual test we wish to run
417417
test: function(configuration, test) {
418418
var Db = configuration.require.Db
@@ -433,7 +433,7 @@ exports['should correctly list collection names with . in the middle'] = {
433433
// Create a collection
434434
db1.collection('test.collection2').insertOne({a:1}, function() {
435435
test.equal(null, err);
436-
436+
437437
// Get listCollections filtering out the name
438438
var cursor = db1.listCollections({name: /test.collection/});
439439
cursor.toArray(function(err, names) {
@@ -460,11 +460,11 @@ exports['should correctly list collection names with . in the middle'] = {
460460
* @ignore
461461
*/
462462
exports['should correctly list collection names with batchSize 1 for 2.8 or higher'] = {
463-
metadata: { requires: {
464-
topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger']
463+
metadata: { requires: {
464+
topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger']
465465
, mongodb: ">= 2.8.0"
466466
} },
467-
467+
468468
// The actual test we wish to run
469469
test: function(configuration, test) {
470470
var Db = configuration.require.Db
@@ -485,7 +485,7 @@ exports['should correctly list collection names with batchSize 1 for 2.8 or high
485485
// Create a collection
486486
db1.collection('test.collection2').insertOne({a:1}, function() {
487487
test.equal(null, err);
488-
488+
489489
// Get listCollections filtering out the name
490490
var cursor = db1.listCollections({name: /test.collection/}, {batchSize:1});
491491
cursor.toArray(function(err, names) {
@@ -505,11 +505,11 @@ exports['should correctly list collection names with batchSize 1 for 2.8 or high
505505
* @ignore
506506
*/
507507
exports['should correctly execute close function in order'] = {
508-
metadata: { requires: {
509-
topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger']
508+
metadata: { requires: {
509+
topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger']
510510
, mongodb: ">= 2.8.0"
511511
} },
512-
512+
513513
// The actual test we wish to run
514514
test: function(configuration, test) {
515515
var Db = configuration.require.Db
@@ -522,9 +522,9 @@ exports['should correctly execute close function in order'] = {
522522
var items = [];
523523

524524
items.push(1);
525-
db.close(function(){
525+
db.close(function(){
526526
test.equal(2, items.length);
527-
test.done();
527+
test.done();
528528
});
529529
items.push(2);
530530
});

0 commit comments

Comments
 (0)