diff --git a/jstests/noPassthrough/timeseries_sample.js b/jstests/noPassthrough/timeseries_sample.js
|
index 71110731a0..d2dd6f773a 100644
|
--- a/jstests/noPassthrough/timeseries_sample.js
|
+++ b/jstests/noPassthrough/timeseries_sample.js
|
@@ -117,9 +117,12 @@ let runSampleTests = (measurementsPerBucket, backupPlanSelected) => {
|
assertUniqueDocuments(result);
|
|
// Check that we have executed the correct branch of the TrialStage.
|
- const optimizedSamplePlan =
|
- coll.explain("executionStats").aggregate([{$sample: {size: sampleSize}}]);
|
- assertPlanForSample(optimizedSamplePlan, backupPlanSelected);
|
+ for (let i = 0; i < 5000; ++i) {
|
+ print("attempt number: " + i);
|
+ const optimizedSamplePlan =
|
+ coll.explain("executionStats").aggregate([{$sample: {size: sampleSize}}]);
|
+ assertPlanForSample(optimizedSamplePlan, backupPlanSelected);
|
+ }
|
|
// Run an agg pipeline with optimization disabled.
|
result = coll.aggregate([{$_internalInhibitOptimization: {}}, {$sample: {size: 1}}]).toArray();
|