@@ -374,8 +374,7 @@ function ClusterCollectionSuite () {
374
374
/// @brief test create
375
375
////////////////////////////////////////////////////////////////////////////////
376
376
377
- testCreateInsufficientDBServers : function ( ) {
378
-
377
+ testCreateInsufficientDBServersDefault : function ( ) {
379
378
try {
380
379
db . _create ( "bigreplication" , { replicationFactor : 8 } ) ;
381
380
fail ( ) ;
@@ -386,6 +385,32 @@ function ClusterCollectionSuite () {
386
385
db . _drop ( 'bigreplication' ) ;
387
386
} ,
388
387
388
+ ////////////////////////////////////////////////////////////////////////////////
389
+ /// @brief test create
390
+ ////////////////////////////////////////////////////////////////////////////////
391
+
392
+ testCreateInsufficientDBServersIgnoreReplicationFactor : function ( ) {
393
+ // should not throw (just a warning)
394
+ db . _create ( "bigreplication" , { replicationFactor : 8 } , { enforceReplicationFactor : false } ) ;
395
+ db . _drop ( 'bigreplication' ) ;
396
+ } ,
397
+
398
+
399
+ ////////////////////////////////////////////////////////////////////////////////
400
+ /// @brief test create
401
+ ////////////////////////////////////////////////////////////////////////////////
402
+
403
+ testCreateInsufficientDBServersEnforceReplicationFactor : function ( ) {
404
+ try {
405
+ db . _create ( "bigreplication" , { replicationFactor : 8 } , { enforceReplicationFactor : true } ) ;
406
+ fail ( ) ;
407
+ }
408
+ catch ( err ) {
409
+ assertEqual ( ERRORS . ERROR_CLUSTER_INSUFFICIENT_DBSERVERS . code , err . errorNum ) ;
410
+ }
411
+ db . _drop ( 'bigreplication' ) ;
5356
td>
412
+ } ,
413
+
389
414
////////////////////////////////////////////////////////////////////////////////
390
415
/// @brief test creation / deleting of documents with replication set
391
416
////////////////////////////////////////////////////////////////////////////////
0 commit comments