@@ -29,6 +29,8 @@ exports['Correctly receive the APM events for an insert'] = {
29
29
30
30
var db = configuration . newDbInstance ( { w :1 } , { poolSize :1 , auto_reconnect :false } ) ;
31
31
db . open ( function ( err , db ) {
32
+ test . equal ( null , err ) ;
33
+
32
34
db . collection ( 'apm_test' ) . insertOne ( { a :1 } ) . then ( function ( r ) {
33
35
test . equal ( 1 , r . insertedCount ) ;
34
36
test . equal ( 1 , started . length ) ;
@@ -223,7 +225,6 @@ var executeOperation = function(assert, client, listener, scenario, test, callba
223
225
} ) ;
224
226
} else {
225
227
params . push ( function ( err , result ) {
226
-
227
228
// Validate the expectations
228
229
test . expectations . forEach ( function ( x , index ) {
229
230
validateExpecations ( assert , x , {
@@ -351,11 +352,10 @@ exports['Correctly receive the APM events for a find with getmore and killcursor
351
352
db . collection ( 'apm_test_2' ) . drop ( function ( err , r ) {
352
353
353
354
// Insert test documents
354
- db . collection ( 'apm_test_2' ) . insertMany ( [ { a :1 } , { a :1 } , { a :1 } , { a :1 } , { a :1 } , { a :1 } ] ) . then ( function ( r ) {
355
+ db . collection ( 'apm_test_2' ) . insertMany ( [ { a :1 } , { a :1 } , { a :1 } , { a :1 } , { a :1 } , { a :1 } ] , { w : 1 } ) . then ( function ( r ) {
355
356
test . equal ( 6 , r . insertedCount ) ;
356
357
357
358
db . collection ( 'apm_test_2' ) . find ( { a :1 } )
358
- . sort ( { a :1 } )
359
359
. project ( { _id : 1 , a :1 } )
360
360
. hint ( { '_id' :1 } )
361
361
. skip ( 1 )
@@ -399,7 +399,7 @@ exports['Correctly receive the APM events for a find with getmore and killcursor
399
399
}
400
400
401
401
exports [ 'Correctly receive the APM failure event for find' ] = {
402
- metadata : { requires : { topology : [ 'single' ] } } ,
402
+ metadata : { requires : { topology : [ 'single' ] , mongodb : ">=2.6.0" } } ,
403
403
404
404
// The actual test we wish to run
405
405
test : function ( configuration , test ) {
@@ -805,7 +805,6 @@ exports['Correctly receive the APM events for a bulk operation'] = {
805
805
806
806
var listener = require ( '../..' ) . instrument ( ) ;
807
807
listener . on ( 'started' , function ( event ) {
808
- // console.log(JSON.stringify(event, null, 2))
809
808
if ( event . commandName == 'insert' || event . commandName == 'update' || event . commandName == 'delete' )
810
809
started . push ( event ) ;
811
810
} ) ;
0 commit comments