diff options
author | Pierlauro Sciarelli <pierlauro.sciarelli@mongodb.com> | 2020-09-08 14:03:30 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-08 15:47:15 +0000 |
commit | 56de72881f50d709b5898c567f646097f7af2694 (patch) | |
tree | cf86520201a7f1b2da432c2d34a5d59aefd79302 | |
parent | f265019ab76d4a73e19e3300b9e52bc927cc6bbe (diff) | |
download | mongo-56de72881f50d709b5898c567f646097f7af2694.tar.gz |
SERVER-50780 Improve cache.collections consistency check in ShardingTest hook
-rw-r--r-- | jstests/libs/override_methods/check_uuids_consistent_across_cluster.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/jstests/libs/override_methods/check_uuids_consistent_across_cluster.js b/jstests/libs/override_methods/check_uuids_consistent_across_cluster.js index 10f7a8a14da..800e3f005b8 100644 --- a/jstests/libs/override_methods/check_uuids_consistent_across_cluster.js +++ b/jstests/libs/override_methods/check_uuids_consistent_across_cluster.js @@ -151,10 +151,17 @@ ShardingTest.prototype.checkUUIDsConsistentAcrossCluster = function() { assert.commandWorked(shardConn.adminCommand( {_flushRoutingTableCacheUpdates: ns, syncFromConfig: false})); - const actualConfigMetadata = - shardConn.getDB("config").getCollection("cache.collections").find({ - "_id": ns - })[0]; + let actualConfigMetadata = shardConn.getDB("config") + .getCollection("cache.collections") + .find({"_id": ns}) + .toArray(); + assert.eq( + actualConfigMetadata.length, + 1, + "Incorrect number of entries in 'cache.collections' have been found for collection '" + + ns + "' on node " + shardConn); + actualConfigMetadata = actualConfigMetadata[0]; + assert.eq(authoritativeCollMetadata.collInfo.uuid, actualConfigMetadata.uuid, "authoritative collection info on config server: " + |