summaryrefslogtreecommitdiff
path: root/jstests/sharding/key_rotation.js
diff options
context:
space:
mode:
authorMisha Tyulenev <misha@mongodb.com>2017-07-31 17:10:07 -0400
committerMisha Tyulenev <misha@mongodb.com>2017-07-31 17:10:19 -0400
commitc9638cd6bcb85f6f5371ca92226d37aecf3d045b (patch)
tree8ae3b3d4cd79805ca10742c3b4a16852856355a8 /jstests/sharding/key_rotation.js
parente3bdbd02624f5dce42aada11b84f28ff14f578da (diff)
downloadmongo-c9638cd6bcb85f6f5371ca92226d37aecf3d045b.tar.gz
SERVER-30249 wait for the signing keys to be available in mongos at startup
Diffstat (limited to 'jstests/sharding/key_rotation.js')
-rw-r--r--jstests/sharding/key_rotation.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/jstests/sharding/key_rotation.js b/jstests/sharding/key_rotation.js
index 3c046e4943a..271c79c4581 100644
--- a/jstests/sharding/key_rotation.js
+++ b/jstests/sharding/key_rotation.js
@@ -61,25 +61,20 @@
// Kill and restart all shards and mongos processes so they have no keys in memory.
st.rs0.stopSet(null /* signal */, true /* forRestart */);
st.rs0.startSet({restart: true});
- st.restartMongos(0);
// The shard primary should return a dummy signed cluster time, because there are no keys.
res = assert.commandWorked(st.rs0.getPrimary().getDB("test").runCommand({isMaster: 1}));
assert.hasFields(res, ["$clusterTime", "operationTime"]);
assert.eq(res.$clusterTime.signature.keyId, NumberLong(0));
- // Mongos shouldn't return a cluster time at all.
- res = assert.commandWorked(st.s.getDB("test").runCommand({isMaster: 1}));
- assert.throws(function() {
- assert.hasFields(res, ["$clusterTime", "operationTime"]);
- }, [], "expected the mongos not to return cluster time or operation time");
-
// Resume key generation.
for (let i = 0; i < st.configRS.nodes.length; i++) {
st.configRS.getPrimary().adminCommand(
{configureFailPoint: "disableKeyGeneration", mode: "off"});
}
+ st.restartMongos(0);
+
// Wait for config server primary to create new keys.
assert.soonNoExcept(function() {
let keys = st.s.getDB("admin").system.keys.find();