SERVER-122254 Increase intensity of Timeseries Write PBT and add resmoke CLI arguments (#50090)
Co-authored-by: Nick Jefferies <nick.jefferies@mongodb.com> GitOrigin-RevId: 86779a1638a546feae35706c1bdbf9c3fc07819f
This commit is contained in:
parent
e042745f1b
commit
6be727c648
@ -4,6 +4,14 @@ selector:
|
||||
- jstests/write_path/timeseries/pbt/*.js
|
||||
|
||||
executor:
|
||||
config:
|
||||
shell_options:
|
||||
global_vars:
|
||||
TestData:
|
||||
fastCheckParameters:
|
||||
numRuns: 75
|
||||
minCommands: 1
|
||||
maxCommands: 250
|
||||
hooks:
|
||||
- class: ValidateCollections
|
||||
- class: CleanEveryN
|
||||
|
||||
@ -237,6 +237,8 @@ DEFAULTS = {
|
||||
"skip_extensions_signature_verification": False,
|
||||
# Enable shell JS debugging
|
||||
"jsdbg": False,
|
||||
# Parameters for fast-check property-based tests
|
||||
"fast_check_parameters": None,
|
||||
}
|
||||
|
||||
_SuiteOptions = collections.namedtuple(
|
||||
@ -774,6 +776,9 @@ HISTORIC_TEST_RUNTIMES = None
|
||||
# Shell debug options
|
||||
JSDBG = None
|
||||
|
||||
# Parameters for fast-check property-based tests (dict parsed from JSON)
|
||||
FAST_CHECK_PARAMETERS = None
|
||||
|
||||
##
|
||||
# Internally used configuration options that aren't exposed to the user
|
||||
##
|
||||
|
||||
@ -919,6 +919,8 @@ flags in common: {common_set}
|
||||
|
||||
_config.JSDBG = config.pop("jsdbg")
|
||||
|
||||
_config.FAST_CHECK_PARAMETERS = config.pop("fast_check_parameters")
|
||||
|
||||
# Internal testing options.
|
||||
_config.INTERNAL_PARAMS = config.pop("internal_params")
|
||||
|
||||
|
||||
@ -323,6 +323,7 @@ def mongo_shell_program(
|
||||
"wiredTigerEngineConfigString": (config.WT_ENGINE_CONFIG, ""),
|
||||
"wiredTigerIndexConfigString": (config.WT_INDEX_CONFIG, ""),
|
||||
"pauseAfterPopulate": (config.PAUSE_AFTER_POPULATE, None),
|
||||
"fastCheckParameters": (config.FAST_CHECK_PARAMETERS, None),
|
||||
}
|
||||
|
||||
test_data = global_vars.get("TestData", {}).copy()
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
import argparse
|
||||
import collections
|
||||
import json
|
||||
import os
|
||||
import os.path
|
||||
import platform
|
||||
@ -1522,7 +1523,7 @@ class RunPlugin(PluginInterface):
|
||||
help="Outputs the tests that would be run.",
|
||||
)
|
||||
|
||||
# TODO: add support for --dryRun=commands
|
||||
# TODO(SERVER-122699): add support for --dryRun=commands
|
||||
parser.add_argument(
|
||||
"--dryRun",
|
||||
action="store",
|
||||
@ -2280,6 +2281,27 @@ class RunPlugin(PluginInterface):
|
||||
),
|
||||
)
|
||||
|
||||
def fast_check_params_parser(params: str | None) -> dict | None:
|
||||
if not params:
|
||||
return None
|
||||
try:
|
||||
result = json.loads(params)
|
||||
if not isinstance(result, dict):
|
||||
raise argparse.ArgumentTypeError("--fastCheckParameters must be a JSON object")
|
||||
return result
|
||||
except json.JSONDecodeError as e:
|
||||
raise argparse.ArgumentTypeError(f"Invalid JSON for --fastCheckParameters: {e}")
|
||||
|
||||
internal_options.add_argument(
|
||||
"--fastCheckParameters",
|
||||
dest="fast_check_parameters",
|
||||
type=fast_check_params_parser,
|
||||
help=(
|
||||
"JSON string of parameters for fast-check property-based tests. "
|
||||
"Supported keys: numRuns, seed, replayPath, path, endOnFailure, minCommands, maxCommands"
|
||||
),
|
||||
)
|
||||
|
||||
evergreen_options = parser.add_argument_group(
|
||||
title=_EVERGREEN_ARGUMENT_TITLE,
|
||||
description=(
|
||||
|
||||
@ -2463,6 +2463,7 @@ tasks:
|
||||
- func: "run tests"
|
||||
vars:
|
||||
suite: timeseries_write_pbt
|
||||
resmoke_args: "--fastCheckParameters=${fastCheckParameters|}"
|
||||
|
||||
################################################
|
||||
# Disagg Storage tasks #
|
||||
|
||||
20
jstests/write_path/timeseries/pbt/lib/fast_check_params.js
Normal file
20
jstests/write_path/timeseries/pbt/lib/fast_check_params.js
Normal file
@ -0,0 +1,20 @@
|
||||
export const getFcParams = () => {
|
||||
return TestData.fastCheckParameters || {};
|
||||
};
|
||||
|
||||
export const getFcAssertArgs = () => {
|
||||
const fcParams = TestData.fastCheckParameters || {};
|
||||
const isSeeded = typeof fcParams.seed === "number";
|
||||
const fcAssertArgs = {
|
||||
numRuns: fcParams.numRuns || 50,
|
||||
seed: fcParams.seed,
|
||||
endOnFailure: fcParams.endOnFailure !== undefined ? fcParams.endOnFailure : isSeeded,
|
||||
path: fcParams.path,
|
||||
};
|
||||
|
||||
jsTest.log.info("FAST_CHECK_PARAMETERS", {
|
||||
fastCheckParameters: Object.keys(fcParams).length > 0 ? fcParams : "not provided, will use defaults",
|
||||
});
|
||||
|
||||
return fcAssertArgs;
|
||||
};
|
||||
@ -18,12 +18,16 @@ import {fc} from "jstests/third_party/fast_check/fc-4.6.0.js";
|
||||
import {makeEmptyModel} from "jstests/write_path/timeseries/pbt/lib/command_grammar.js";
|
||||
import {makeTimeseriesCommandSequenceArb} from "jstests/write_path/timeseries/pbt/lib/command_arbitraries.js";
|
||||
import {assertCollectionsMatch} from "jstests/write_path/timeseries/pbt/lib/assertions.js";
|
||||
import {getFcParams, getFcAssertArgs} from "jstests/write_path/timeseries/pbt/lib/fast_check_params.js";
|
||||
import {getTimeseriesCollForRawOps} from "jstests/libs/raw_operation_utils.js";
|
||||
|
||||
const fcParams = getFcParams();
|
||||
const fcAssertArgs = getFcAssertArgs();
|
||||
const ctrlCollName = jsTestName() + "_control";
|
||||
const tsCollName = jsTestName() + "_timeseries";
|
||||
const timeField = "ts";
|
||||
const metaField = "meta";
|
||||
const metaValue = "metavalue";
|
||||
|
||||
describe("Basic comparative PBT for timeseries inserts", () => {
|
||||
let tsColl;
|
||||
@ -43,13 +47,11 @@ describe("Basic comparative PBT for timeseries inserts", () => {
|
||||
};
|
||||
|
||||
it("keeps tsColl and ctrlColl in sync under insert/batch-insert/delete", () => {
|
||||
const metaValue = "metavalue";
|
||||
|
||||
const programArb = makeTimeseriesCommandSequenceArb(
|
||||
/* minCommands */ 1,
|
||||
/* maxCommands */ 30,
|
||||
/* timeField */ "ts",
|
||||
/* metaField */ "meta",
|
||||
/* minCommands */ fcParams.minCommands || 1,
|
||||
/* maxCommands */ fcParams.maxCommands || 30,
|
||||
/* timeField */ timeField,
|
||||
/* metaField */ metaField,
|
||||
/* metaValue */ metaValue,
|
||||
/* minFields */ 1,
|
||||
/* maxFields */ 3,
|
||||
@ -57,7 +59,7 @@ describe("Basic comparative PBT for timeseries inserts", () => {
|
||||
/* maxDocs */ 10,
|
||||
/* options */ {}, // {intRange, dateRange} if you want to override
|
||||
/* fieldNameArb */ undefined, // use default short-string field names
|
||||
/* replayPath */ undefined, // replace this value with the replay path to replicate a failure
|
||||
/* replayPath */ fcParams.replayPath,
|
||||
);
|
||||
|
||||
fc.assert(
|
||||
@ -68,7 +70,7 @@ describe("Basic comparative PBT for timeseries inserts", () => {
|
||||
assertCollectionsMatch(tsColl, ctrlColl);
|
||||
})
|
||||
.beforeEach(beforeHook),
|
||||
{numRuns: 50},
|
||||
fcAssertArgs,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -19,6 +19,9 @@ import {makeEmptyModel} from "jstests/write_path/timeseries/pbt/lib/command_gram
|
||||
import {makeTimeseriesCommandSequenceArb} from "jstests/write_path/timeseries/pbt/lib/command_arbitraries.js";
|
||||
import {assertCollectionsMatch} from "jstests/write_path/timeseries/pbt/lib/assertions.js";
|
||||
import {getTimeseriesCollForRawOps} from "jstests/libs/raw_operation_utils.js";
|
||||
import {getFcParams, getFcAssertArgs} from "jstests/write_path/timeseries/pbt/lib/fast_check_params.js";
|
||||
const fcParams = getFcParams();
|
||||
const fcAssertArgs = getFcAssertArgs();
|
||||
|
||||
const ctrlCollName = jsTestName() + "_control";
|
||||
const tsCollName = jsTestName() + "_timeseries";
|
||||
@ -186,12 +189,10 @@ describe("Basic comparative PBT for timeseries inserts", () => {
|
||||
return accumulatedStats;
|
||||
};
|
||||
|
||||
// Test each range against the the property that a Timeseries and Standard
|
||||
// collection remain the same for a given set of commands.
|
||||
for (const [label, dateRange] of Object.entries(extendedDateRanges)) {
|
||||
const programArb = makeTimeseriesCommandSequenceArb(
|
||||
/* minCommands */ 1,
|
||||
/* maxCommands */ 30,
|
||||
/* minCommands */ fcParams.minCommands || 1,
|
||||
/* maxCommands */ fcParams.maxCommands || 30,
|
||||
/* timeField */ timeField,
|
||||
/* metaField */ metaField,
|
||||
/* metaValue */ metaValue,
|
||||
@ -201,7 +202,7 @@ describe("Basic comparative PBT for timeseries inserts", () => {
|
||||
/* maxDocs */ 10,
|
||||
/* options */ {ranges: {dateRange}}, // {intRange, dateRange} if you want to override
|
||||
/* fieldNameArb */ undefined, // use default short-string field names
|
||||
/* replayPath */ undefined, // replace this value with the replay path to replicate a failure
|
||||
/* replayPath */ fcParams.replayPath,
|
||||
);
|
||||
it(`keeps tsColl and ctrlColl in sync under insert/batch-insert/delete: ${label}`, () => {
|
||||
fc.assert(
|
||||
@ -219,7 +220,7 @@ describe("Basic comparative PBT for timeseries inserts", () => {
|
||||
.reduce(bucketCollectionQueryStatsReducer, stats);
|
||||
})
|
||||
.beforeEach(beforeHook),
|
||||
{numRuns: 50},
|
||||
fcAssertArgs,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@ -22,12 +22,17 @@ import {
|
||||
makeGeospatialQueryArb,
|
||||
} from "jstests/write_path/timeseries/pbt/lib/geodata_arbitraries.js";
|
||||
import {assertCollectionsMatch} from "jstests/write_path/timeseries/pbt/lib/assertions.js";
|
||||
import {getFcParams, getFcAssertArgs} from "jstests/write_path/timeseries/pbt/lib/fast_check_params.js";
|
||||
import {getTimeseriesCollForRawOps} from "jstests/libs/raw_operation_utils.js";
|
||||
|
||||
const fcParams = getFcParams();
|
||||
const fcAssertArgs = getFcAssertArgs();
|
||||
const ctrlCollName = jsTestName() + "_control";
|
||||
const tsCollName = jsTestName() + "_timeseries";
|
||||
|
||||
const geoField = "loc";
|
||||
const timeField = "ts";
|
||||
const metaField = "meta";
|
||||
const metaValue = "geospatial";
|
||||
|
||||
describe("Geospatial Query Comparative Test for Timeseries", () => {
|
||||
@ -53,10 +58,10 @@ describe("Geospatial Query Comparative Test for Timeseries", () => {
|
||||
|
||||
it("keeps tsColl and ctrlColl in sync under insert/batch-insert/delete of GeoPoint data", () => {
|
||||
const programArb = makeTimeseriesCommandSequenceArb(
|
||||
/* minCommands */ 1,
|
||||
/* maxCommands */ 30,
|
||||
/* timeField */ "ts",
|
||||
/* metaField */ "meta",
|
||||
/* minCommands */ fcParams.minCommands || 1,
|
||||
/* maxCommands */ fcParams.maxCommands || 30,
|
||||
/* timeField */ timeField,
|
||||
/* metaField */ metaField,
|
||||
/* metaValue */ metaValue,
|
||||
/* minFields */ 1,
|
||||
/* maxFields */ 1,
|
||||
@ -66,7 +71,7 @@ describe("Geospatial Query Comparative Test for Timeseries", () => {
|
||||
explicitArbitraries: {[geoField]: makeGeoArbFactory(makeGeoPointArb)},
|
||||
},
|
||||
/* fieldNameArb */ undefined, // use default short-string field names
|
||||
/* replayPath */ undefined, // replace this value with the replay path to replicate a failure
|
||||
/* replayPath */ fcParams.replayPath,
|
||||
);
|
||||
|
||||
fc.assert(
|
||||
@ -77,16 +82,16 @@ describe("Geospatial Query Comparative Test for Timeseries", () => {
|
||||
assertCollectionsMatch(tsColl, ctrlColl);
|
||||
})
|
||||
.beforeEach(beforeHook),
|
||||
{numRuns: 50},
|
||||
fcAssertArgs,
|
||||
);
|
||||
});
|
||||
|
||||
it("produces equal geonear queries", () => {
|
||||
const programArb = makeTimeseriesCommandSequenceArb(
|
||||
/* minCommands */ 1,
|
||||
/* maxCommands */ 30,
|
||||
/* timeField */ "ts",
|
||||
/* metaField */ "meta",
|
||||
/* minCommands */ fcParams.minCommands || 1,
|
||||
/* maxCommands */ fcParams.maxCommands || 30,
|
||||
/* timeField */ timeField,
|
||||
/* metaField */ metaField,
|
||||
/* metaValue */ metaValue,
|
||||
/* minFields */ 1,
|
||||
/* maxFields */ 1,
|
||||
@ -96,7 +101,7 @@ describe("Geospatial Query Comparative Test for Timeseries", () => {
|
||||
explicitArbitraries: {[geoField]: makeGeoArbFactory(makeGeoPointArb)},
|
||||
},
|
||||
/* fieldNameArb */ undefined, // use default short-string field names
|
||||
/* replayPath */ undefined, // replace this value with the replay path to replicate a failure
|
||||
/* replayPath */ fcParams.replayPath,
|
||||
);
|
||||
|
||||
fc.assert(
|
||||
@ -113,7 +118,7 @@ describe("Geospatial Query Comparative Test for Timeseries", () => {
|
||||
},
|
||||
)
|
||||
.beforeEach(beforeHook),
|
||||
{numRuns: 50},
|
||||
fcAssertArgs,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -16,8 +16,12 @@ import {fc} from "jstests/third_party/fast_check/fc-4.6.0.js";
|
||||
import {makeEmptyModel} from "jstests/write_path/timeseries/pbt/lib/command_grammar.js";
|
||||
import {makeTimeseriesCommandSequenceArb} from "jstests/write_path/timeseries/pbt/lib/command_arbitraries.js";
|
||||
import {assertCollectionsMatch} from "jstests/write_path/timeseries/pbt/lib/assertions.js";
|
||||
import {getFcParams, getFcAssertArgs} from "jstests/write_path/timeseries/pbt/lib/fast_check_params.js";
|
||||
import {getTimeseriesCollForRawOps} from "jstests/libs/raw_operation_utils.js";
|
||||
|
||||
const fcParams = getFcParams();
|
||||
const fcAssertArgs = getFcAssertArgs();
|
||||
|
||||
const ctrlCollName = jsTestName() + "_control";
|
||||
const tsCollName = jsTestName() + "_timeseries";
|
||||
const timeField = "ts";
|
||||
@ -188,8 +192,8 @@ describe("Comparative PBT for mixed-schema timeseries field streams", () => {
|
||||
|
||||
it("keeps tsColl and ctrlColl in sync under mixed-schema field streams", () => {
|
||||
const programArb = makeTimeseriesCommandSequenceArb(
|
||||
1, // minCommands
|
||||
30, // maxCommands
|
||||
fcParams.minCommands || 1, // minCommands
|
||||
fcParams.maxCommands || 30, // maxCommands
|
||||
timeField,
|
||||
metaField,
|
||||
metaValue,
|
||||
@ -198,8 +202,11 @@ describe("Comparative PBT for mixed-schema timeseries field streams", () => {
|
||||
0, // minDocs
|
||||
50, // maxDocs
|
||||
{
|
||||
// options
|
||||
mixedSchemaChance: 0.5,
|
||||
},
|
||||
undefined, //fieldNameArb
|
||||
fcParams.replayPath,
|
||||
);
|
||||
|
||||
fc.assert(
|
||||
@ -214,7 +221,7 @@ describe("Comparative PBT for mixed-schema timeseries field streams", () => {
|
||||
stats = updateFinalCollectionFieldTypeStats(stats, tsColl.find().toArray());
|
||||
})
|
||||
.beforeEach(beforeHook),
|
||||
{numRuns: 50},
|
||||
fcAssertArgs,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -24,8 +24,12 @@ import {
|
||||
makeInsertOldBucketCommandArb,
|
||||
} from "jstests/write_path/timeseries/pbt/lib/command_arbitraries.js";
|
||||
import {assertCollectionsMatch} from "jstests/write_path/timeseries/pbt/lib/assertions.js";
|
||||
import {getFcParams, getFcAssertArgs} from "jstests/write_path/timeseries/pbt/lib/fast_check_params.js";
|
||||
import {getTimeseriesCollForRawOps} from "jstests/libs/raw_operation_utils.js";
|
||||
|
||||
const fcParams = getFcParams();
|
||||
const fcAssertArgs = getFcAssertArgs();
|
||||
|
||||
const ctrlCollName = jsTestName() + "_control";
|
||||
const tsCollName = jsTestName() + "_timeseries";
|
||||
const timeField = "ts";
|
||||
@ -78,7 +82,7 @@ describe("PBT exercising bucket reopening via InsertOldBucketCommand", () => {
|
||||
const programArb = fc.commands(
|
||||
[batchInsertArb, batchInsertArb, batchInsertArb, batchInsertArb, batchInsertArb, insertOldBucketArb],
|
||||
{
|
||||
maxCommands: 150,
|
||||
maxCommands: fcParams.maxCommands || 100, // maxCommands
|
||||
},
|
||||
);
|
||||
|
||||
@ -102,7 +106,7 @@ describe("PBT exercising bucket reopening via InsertOldBucketCommand", () => {
|
||||
}
|
||||
})
|
||||
.beforeEach(beforeHook),
|
||||
{numRuns: 50},
|
||||
fcAssertArgs,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -18,12 +18,16 @@ import {fc} from "jstests/third_party/fast_check/fc-3.1.0.js";
|
||||
import {makeEmptyModel} from "jstests/write_path/timeseries/pbt/lib/command_grammar.js";
|
||||
import {makeTimeseriesCommandSequenceArb} from "jstests/write_path/timeseries/pbt/lib/command_arbitraries.js";
|
||||
import {assertCollectionsMatch} from "jstests/write_path/timeseries/pbt/lib/assertions.js";
|
||||
import {getFcParams, getFcAssertArgs} from "jstests/write_path/timeseries/pbt/lib/fast_check_params.js";
|
||||
import {getTimeseriesCollForRawOps} from "jstests/libs/raw_operation_utils.js";
|
||||
|
||||
const fcParams = getFcParams();
|
||||
const fcAssertArgs = getFcAssertArgs();
|
||||
const ctrlCollName = jsTestName() + "_control";
|
||||
const tsCollName = jsTestName() + "_timeseries";
|
||||
const timeField = "ts";
|
||||
const metaField = "meta";
|
||||
const metaValue = "metavalue";
|
||||
|
||||
describe("PBT for timeseries inserts biasing towards generating long runs of matching or monotonically in/decreasing values", () => {
|
||||
let tsColl;
|
||||
@ -43,13 +47,11 @@ describe("PBT for timeseries inserts biasing towards generating long runs of mat
|
||||
};
|
||||
|
||||
it("keeps tsColl and ctrlColl in sync under insert/batch-insert/delete", () => {
|
||||
const metaValue = "metavalu";
|
||||
|
||||
const programArb = makeTimeseriesCommandSequenceArb(
|
||||
/* minCommands */ 1,
|
||||
/* maxCommands */ 30,
|
||||
/* timeField */ "ts",
|
||||
/* metaField */ "meta",
|
||||
/* minCommands */ fcParams.minCommands || 1,
|
||||
/* maxCommands */ fcParams.maxCommands || 30,
|
||||
/* timeField */ timeField,
|
||||
/* metaField */ metaField,
|
||||
/* metaValue */ metaValue,
|
||||
/* minFields */ 1,
|
||||
/* maxFields */ 3,
|
||||
@ -57,7 +59,7 @@ describe("PBT for timeseries inserts biasing towards generating long runs of mat
|
||||
/* maxDocs */ 10,
|
||||
/* options */ {runFrequency: 0.5}, // {intRange, dateRange} if you want to override
|
||||
/* fieldNameArb */ undefined, // use default short-string field names
|
||||
/* replayPath */ undefined, // replace this value with the replay path to replicate a failure
|
||||
/* replayPath */ fcParams.replayPath,
|
||||
);
|
||||
|
||||
fc.assert(
|
||||
@ -68,7 +70,7 @@ describe("PBT for timeseries inserts biasing towards generating long runs of mat
|
||||
assertCollectionsMatch(tsColl, ctrlColl);
|
||||
})
|
||||
.beforeEach(beforeHook),
|
||||
{numRuns: 50},
|
||||
fcAssertArgs,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user