diff options
author | Alya Berciu <alya.berciu@mongodb.com> | 2022-11-03 19:53:59 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-11-03 20:43:25 +0000 |
commit | fd269ec2272cddb55405efc17828fb88abd2d1f9 (patch) | |
tree | 9ea1d27c222a4aa376656eb2299eca17572841fc /jstests | |
parent | 4aea76be781c61097b945afd70e1c16de0ce5e3e (diff) | |
download | mongo-fd269ec2272cddb55405efc17828fb88abd2d1f9.tar.gz |
SERVER-68490 Robustify ce_histogram.js
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/cqf/analyze/ce_histogram.js (renamed from jstests/cqf/ce_histogram.js) | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/jstests/cqf/ce_histogram.js b/jstests/cqf/analyze/ce_histogram.js index 58d9c43b829..7667b641655 100644 --- a/jstests/cqf/ce_histogram.js +++ b/jstests/cqf/analyze/ce_histogram.js @@ -274,8 +274,21 @@ if (checkSBEEnabled(db, ["featureFlagSbeFull"], true)) { return; } -verifyCEForNDV(1); -verifyCEForNDV(2); -verifyCEForNDV(3); -verifyCEForNDV(10); +// We will be updating some query knobs, so store the old state and restore it after the test. +const {internalQueryCardinalityEstimatorMode, internalQueryFrameworkControl} = db.adminCommand({ + getParameter: 1, + internalQueryCardinalityEstimatorMode: 1, + internalQueryFrameworkControl: 1, +}); + +try { + verifyCEForNDV(1); + verifyCEForNDV(2); + verifyCEForNDV(3); + verifyCEForNDV(10); +} finally { + // Reset query knobs to their original state. + assert.commandWorked(db.adminCommand( + {setParameter: 1, internalQueryCardinalityEstimatorMode, internalQueryFrameworkControl})); +} }()); |