summaryrefslogtreecommitdiff
path: root/jstests/sharding/read_pref.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/read_pref.js')
-rwxr-xr-xjstests/sharding/read_pref.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/jstests/sharding/read_pref.js b/jstests/sharding/read_pref.js
index 9b97fb8daf3..e2a46c7aba5 100755
--- a/jstests/sharding/read_pref.js
+++ b/jstests/sharding/read_pref.js
@@ -80,11 +80,12 @@ var doTest = function(useDollarQuerySyntax) {
var coll = conn.getDB( 'test' ).user;
assert.soon(function() {
- coll.insert({ x: 1 });
- var err = coll.getDB().getLastError(NODES);
- if (err == null) {
+ var res = coll.insert({ x: 1 }, { writeConcern: { w: NODES }});
+ if (!res.hasWriteError()) {
return true;
}
+
+ var err = res.getWriteError().errmsg;
// Transient transport errors may be expected b/c of the replSetReconfig
if (err.indexOf("transport error") == -1) {
throw err;