-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.6.2, 4.0.0
-
Component/s: None
-
None
-
Empty show more show less
-
Not Needed
This test fails, according to the comment in ReadPreference#resolve
// The transaction’s read preference MUST override all other user configurable read preferences.
it('should use session readPreference', function(done) { const configuration = this.configuration; const client = this.configuration.newClient(configuration.writeConcernMax(), { useUnifiedTopology: true, readPreference: 'primaryPreferred' }); client.connect((err, client) => { expect(err).to.not.exist; this.defer(() => client.close()); const session = client.startSession({ readPreference: 'secondary', causalConsistency: true }); const result = ReadPreference.resolve(client, { session: session }); expect(result.mode).to.equal('secondary'); done(); }); });