diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2020-01-29 10:47:22 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2020-01-29 11:37:03 -0500 |
commit | 2a5433168a53044cb6b4fa8083e4cfd7ba142221 (patch) | |
tree | 1a1694a951968ead9cdb4e5e048d75a560a40f68 | |
parent | 132aa852b1ae87f48165dbdf50943f32d2376c73 (diff) | |
download | mongo-2a5433168a53044cb6b4fa8083e4cfd7ba142221.tar.gz |
Revert "SERVER-45599 Backport the 'assertChangeStreamEventEq' function from master"r4.0.16-rc0r4.0.16
This reverts commit 0363c1d062483022c7c1d2f2357edee3713073ca.
-rw-r--r-- | jstests/libs/change_stream_util.js | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/jstests/libs/change_stream_util.js b/jstests/libs/change_stream_util.js index b52896d08b7..5cb8b933ba3 100644 --- a/jstests/libs/change_stream_util.js +++ b/jstests/libs/change_stream_util.js @@ -53,33 +53,6 @@ function assertInvalidateOp({cursor, opType}) { } } -/** - * Helper to check whether a change stream event matches the given expected event. Ignores the - * resume token and clusterTime unless they are explicitly listed in the expectedEvent. - */ -function assertChangeStreamEventEq(actualEvent, expectedEvent) { - const testEvent = Object.assign({}, actualEvent); - if (!expectedEvent.hasOwnProperty("_id")) { - delete testEvent._id; // Remove the resume token, if present. - } - if (!expectedEvent.hasOwnProperty("clusterTime")) { - delete testEvent.clusterTime; // Remove the cluster time, if present. - } - - // The change stream transaction passthrough causes operations to have txnNumber and lsid - // values that the test doesn't expect, which can cause comparisons to fail. - if (!expectedEvent.hasOwnProperty("txnNumber")) { - delete testEvent.txnNumber; // Remove the txnNumber, if present. - } - if (!expectedEvent.hasOwnProperty("lsid")) { - delete testEvent.lsid; // Remove the lsid, if present. - } - assert.docEq(testEvent, - expectedEvent, - "Change did not match expected change. Expected change: " + tojson(expectedEvent) + - ", Actual change: " + tojson(testEvent)); -} - function ChangeStreamTest(_db, name = "ChangeStreamTest") { load("jstests/libs/namespace_utils.js"); // For getCollectionNameFromFullNamespace. |