@@ -69,7 +69,7 @@ sh.assertRetryableCommandWorkedOrFailedWithCodes = function(cmd, msg, expectedEr
6969 var res = undefined ;
7070 assert . soon ( function ( ) {
7171 try {
72- res = cmd ( ) ;
72+ res = assert . commandWorked ( cmd ( ) ) ;
7373 return true ;
7474 } catch ( err ) {
7575 if ( err instanceof WriteError && ErrorCodes . isRetriableError ( err . code ) ) {
@@ -271,7 +271,7 @@ sh.disableAutoMerge = function(coll) {
271271 }
272272
273273 return sh . assertRetryableCommandWorkedOrFailedWithCodes ( ( ) => {
274- dbase . getSiblingDB ( "config" ) . collections . update (
274+ return dbase . getSiblingDB ( "config" ) . collections . update (
275275 { _id : coll + "" } ,
276276 { $set : { "enableAutoMerge" : false } } ,
277277 { writeConcern : { w : 'majority' , wtimeout : 60000 } } ) ;
@@ -290,7 +290,7 @@ sh.enableAutoMerge = function(coll) {
290290 }
291291
292292 return sh . assertRetryableCommandWorkedOrFailedWithCodes ( ( ) => {
293- dbase . getSiblingDB ( "config" ) . collections . update (
293+ return dbase . getSiblingDB ( "config" ) . collections . update (
294294 { _id : coll + "" } ,
295295 { $unset : { "enableAutoMerge" : 1 } } ,
296296 { writeConcern : { w : 'majority' , wtimeout : 60000 } } ) ;
@@ -369,7 +369,7 @@ sh.disableBalancing = function(coll) {
369369 }
370370
371371 return sh . assertRetryableCommandWorkedOrFailedWithCodes ( ( ) => {
372- dbase . getSiblingDB ( "config" ) . collections . update (
372+ return dbase . getSiblingDB ( "config" ) . collections . update (
373373 { _id : coll + "" } ,
374374 { $set : { "noBalance" : true } } ,
375375 { writeConcern : { w : 'majority' , wtimeout : 60000 } } ) ;
@@ -388,7 +388,7 @@ sh.enableBalancing = function(coll) {
388388 }
389389
390390 return sh . assertRetryableCommandWorkedOrFailedWithCodes ( ( ) => {
391- dbase . getSiblingDB ( "config" ) . collections . update (
391+ return dbase . getSiblingDB ( "config" ) . collections . update (
392392 { _id : coll + "" } ,
393393 { $set : { "noBalance" : false } } ,
394394 { writeConcern : { w : 'majority' , wtimeout : 60000 } } ) ;
0 commit comments