Skip to content

Commit f49669f

Browse files
committed
SERVER-12458 Wait for insert to get in before killing the server in gle_sharded_wc.js
1 parent f504962 commit f49669f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jstests/sharding/gle_sharded_wc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,12 @@ assert.eq(coll.count(), 0);
132132
// Successful bulk insert on two hosts, host changes before gle (error contacting host)
133133
coll.remove({});
134134
coll.insert([{ _id : 1 }, { _id : -1 }]);
135+
// Wait for write to be written to shards before shutting it down.
136+
printjson(gle = coll.getDB().runCommand({ getLastError : 1 }));
137+
135138
st.rs0.stop(st.rs0.getPrimary(), true); // wait for stop
136139
printjson(gle = coll.getDB().runCommand({ getLastError : 1 }));
140+
// Should get an error about contacting dead host.
137141
assert(!gle.ok);
138142
assert(gle.errmsg);
139143
assert.eq(coll.count({ _id : 1 }), 1);

0 commit comments

Comments
 (0)