File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2011,6 +2011,7 @@ describe('Shell API (integration)', function() {
2011
2011
it ( 'DBQuery.batchSize takes precedence over config' , async ( ) => {
2012
2012
await shellApi . config . set ( 'batchSize' , 10 ) ;
2013
2013
shellApi . DBQuery . batchSize = 30 ;
2014
+ expect ( shellApi . DBQuery . batchSize ) . to . equal ( 30 ) ;
2014
2015
expect ( ( await collection . find ( ) . _it ( ) ) . documents ) . to . have . lengthOf ( 30 ) ;
2015
2016
} ) ;
2016
2017
@@ -2086,4 +2087,22 @@ describe('Shell API (integration)', function() {
2086
2087
} ) ;
2087
2088
} ) ;
2088
2089
} ) ;
2090
+
2091
+ describe ( 'interruption' , ( ) => {
2092
+ it ( 'allows interrupting and resuming Mongo instances' , async ( ) => {
2093
+ expect ( internalState . interrupted . isSet ( ) ) . to . equal ( false ) ;
2094
+ expect ( await database . runCommand ( { ping : 1 } ) ) . to . deep . equal ( { ok : 1 } ) ;
2095
+ await internalState . onInterruptExecution ( ) ;
2096
+ expect ( internalState . interrupted . isSet ( ) ) . to . equal ( true ) ;
2097
+ try {
2098
+ await database . runCommand ( { ping : 1 } ) ;
2099
+ expect . fail ( 'missed exceptino' ) ;
2100
+ } catch ( e ) {
2101
+ expect ( e . name ) . to . equal ( 'MongoshInterruptedError' ) ;
2102
+ }
2103
+ await internalState . onResumeExecution ( ) ;
2104
+ expect ( internalState . interrupted . isSet ( ) ) . to . equal ( false ) ;
2105
+ expect ( await database . runCommand ( { ping : 1 } ) ) . to . deep . equal ( { ok : 1 } ) ;
2106
+ } ) ;
2107
+ } ) ;
2089
2108
} ) ;
You can’t perform that action at this time.
0 commit comments