Skip to content

Commit 9da073a

Browse files
committed
fix(shell-api): relax queryHash checks in PlanCache test
The exact hashes are different on the latest versions of the server.
1 parent cbfceb0 commit 9da073a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/shell-api/src/integration.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,10 +1988,12 @@ describe('Shell API (integration)', function() {
19881988
const planCache = collection.getPlanCache();
19891989
const res = await planCache.list([{ $project: { createdFromQuery: 1, queryHash: 1 } }]);
19901990
expect(res).to.deep.equal([
1991-
{ createdFromQuery: { query: { quantity: { $gte: 5 }, type: 'apparel' }, sort: { }, projection: { } }, queryHash: '4D151C4C' },
1992-
{ createdFromQuery: { query: { quantity: { $gte: 20 } }, sort: { }, projection: { } }, queryHash: '23B19B75' },
1993-
{ createdFromQuery: { query: { item: 'abc', price: { $gte: 5 } }, sort: { }, projection: { } }, queryHash: '117A6B10' },
1994-
{ createdFromQuery: { query: { item: 'abc', price: { $gte: 10 } }, sort: { }, projection: { } }, queryHash: '117A6B10' }
1991+
// We do not test for the exact query hashes here, as they can vary between
1992+
// server versions. Hashes for queries 3 and 4 are always equal currently.
1993+
{ createdFromQuery: { query: { quantity: { $gte: 5 }, type: 'apparel' }, sort: { }, projection: { } }, queryHash: `${res[0].queryHash}` },
1994+
{ createdFromQuery: { query: { quantity: { $gte: 20 } }, sort: { }, projection: { } }, queryHash: `${res[1].queryHash}` },
1995+
{ createdFromQuery: { query: { item: 'abc', price: { $gte: 5 } }, sort: { }, projection: { } }, queryHash: `${res[2].queryHash}` },
1996+
{ createdFromQuery: { query: { item: 'abc', price: { $gte: 10 } }, sort: { }, projection: { } }, queryHash: `${res[2].queryHash}` }
19951997
]);
19961998
});
19971999
});

0 commit comments

Comments
 (0)