@@ -68,62 +68,6 @@ describe('Sharding (Read Preference)', function() {
68
68
}
69
69
} ) ;
70
70
71
- /**
72
- * @ignore
73
- */
74
- it ( 'Should correctly fail a Mongos read using a unsupported read preference' , {
75
- metadata : { requires : { topology : 'sharded' } } ,
76
-
77
- // The actual test we wish to run
78
- test : function ( done ) {
79
- const configuration = this . configuration ;
80
-
81
- // Connect using the mongos connections
82
- const client = new MongoClient ( configuration . url ( ) , { w : 0 } ) ;
83
- client . connect ( function ( err ) {
84
- expect ( err ) . to . not . exist ;
85
- const db = client . db ( configuration . db ) ;
86
-
87
- // Perform a simple insert into a collection
88
- const collection = db . collection ( 'shard_test2' ) ;
89
- // Insert a simple doc
90
- collection . insertOne ( { test : 1 } , { w : 'majority' , wtimeout : 10000 } , function ( err ) {
91
- expect ( err ) . to . not . exist ;
92
-
93
- // Set debug level for the driver
94
- Logger . setLevel ( 'debug' ) ;
95
-
96
- let gotMessage = false ;
97
- // Get the current logger
98
- Logger . setCurrentLogger ( function ( message , options ) {
99
- if (
100
- options . type === 'debug' &&
101
- options . className === 'Cursor' &&
102
- options . message . indexOf ( '"mode":"notsupported"' ) !== - 1
103
- ) {
104
- gotMessage = true ;
105
- }
106
- } ) ;
107
-
108
- collection . findOne (
109
- { test : 1 } ,
110
- { readPreference : new ReadPreference ( 'notsupported' ) } ,
111
- function ( err ) {
112
- expect ( err ) . to . exist ;
113
- expect ( gotMessage ) . to . equal ( true ) ;
114
-
115
- // Set error level for the driver
116
- Logger . setLevel ( 'error' ) ;
117
- // Close db connection
118
- client . close ( ) ;
119
- done ( ) ;
120
- }
121
- ) ;
122
- } ) ;
123
- } ) ;
124
- }
125
- } ) ;
126
-
127
71
/**
128
72
* @ignore
129
73
*/
0 commit comments