mirror of https://github.com/apache/lucene.git
tests.multiplier could be omitted in failed test reproduce line (#12752)
The default tests.multiplier passed from gradle was 1, but LuceneTestCase tried to compute its default value from TESTS_NIGHTLY. This could lead to subtle errors: nightly mode failures would not report tests.multipler=1 and when started from the IDE, the tests.multiplier would be set to 2 (leading to different randomness).
This commit is contained in:
parent
1f3f3ae14f
commit
d6836d3d0e
|
@ -67,7 +67,7 @@ allprojects {
|
||||||
// seed, repetition and amplification.
|
// seed, repetition and amplification.
|
||||||
[propName: 'tests.seed', value: { -> rootSeed }, description: "Sets the master randomization seed."],
|
[propName: 'tests.seed', value: { -> rootSeed }, description: "Sets the master randomization seed."],
|
||||||
[propName: 'tests.iters', value: null, description: "Duplicate (re-run) each test case N times."],
|
[propName: 'tests.iters', value: null, description: "Duplicate (re-run) each test case N times."],
|
||||||
[propName: 'tests.multiplier', value: 1, description: "Value multiplier for randomized tests."],
|
[propName: 'tests.multiplier', value: null, description: "Value multiplier for randomized tests."],
|
||||||
[propName: 'tests.maxfailures', value: null, description: "Skip tests after a given number of failures."],
|
[propName: 'tests.maxfailures', value: null, description: "Skip tests after a given number of failures."],
|
||||||
[propName: 'tests.timeoutSuite', value: null, description: "Timeout (in millis) for an entire suite."],
|
[propName: 'tests.timeoutSuite', value: null, description: "Timeout (in millis) for an entire suite."],
|
||||||
[propName: 'tests.failfast', value: "false", description: "Stop the build early on failure.", buildOnly: true],
|
[propName: 'tests.failfast', value: "false", description: "Stop the build early on failure.", buildOnly: true],
|
||||||
|
|
|
@ -285,6 +285,9 @@ Bug Fixes
|
||||||
Build
|
Build
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
* GITHUB#12752: tests.multiplier could be omitted in test failure reproduce lines (esp. in
|
||||||
|
nightly mode). (Dawid Weiss)
|
||||||
|
|
||||||
* GITHUB#12742: JavaCompile tasks may be in up-to-date state when modular dependencies have changed
|
* GITHUB#12742: JavaCompile tasks may be in up-to-date state when modular dependencies have changed
|
||||||
leading to odd runtime errors (Chris Hostetter, Dawid Weiss)
|
leading to odd runtime errors (Chris Hostetter, Dawid Weiss)
|
||||||
|
|
||||||
|
|
|
@ -476,7 +476,12 @@ public abstract class LuceneTestCase extends Assert {
|
||||||
* of iterations to scale your tests (for nightly builds).
|
* of iterations to scale your tests (for nightly builds).
|
||||||
*/
|
*/
|
||||||
public static final int RANDOM_MULTIPLIER =
|
public static final int RANDOM_MULTIPLIER =
|
||||||
systemPropertyAsInt("tests.multiplier", TEST_NIGHTLY ? 2 : 1);
|
systemPropertyAsInt("tests.multiplier", defaultRandomMultiplier());
|
||||||
|
|
||||||
|
/** Compute the default value of the random multiplier (based on {@link #TEST_NIGHTLY}). */
|
||||||
|
static int defaultRandomMultiplier() {
|
||||||
|
return TEST_NIGHTLY ? 2 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
/** Leave temporary files on disk, even on successful runs. */
|
/** Leave temporary files on disk, even on successful runs. */
|
||||||
public static final boolean LEAVE_TEMPORARY;
|
public static final boolean LEAVE_TEMPORARY;
|
||||||
|
|
|
@ -189,7 +189,8 @@ public final class RunListenerPrintReproduceInfo extends RunListener {
|
||||||
addVmOpt(b, "tests.seed", RandomizedContext.current().getRunnerSeedAsString());
|
addVmOpt(b, "tests.seed", RandomizedContext.current().getRunnerSeedAsString());
|
||||||
|
|
||||||
// Test groups and multipliers.
|
// Test groups and multipliers.
|
||||||
if (RANDOM_MULTIPLIER > 1) addVmOpt(b, "tests.multiplier", RANDOM_MULTIPLIER);
|
if (RANDOM_MULTIPLIER != LuceneTestCase.defaultRandomMultiplier())
|
||||||
|
addVmOpt(b, "tests.multiplier", RANDOM_MULTIPLIER);
|
||||||
if (TEST_NIGHTLY) addVmOpt(b, SYSPROP_NIGHTLY, TEST_NIGHTLY);
|
if (TEST_NIGHTLY) addVmOpt(b, SYSPROP_NIGHTLY, TEST_NIGHTLY);
|
||||||
if (TEST_WEEKLY) addVmOpt(b, SYSPROP_WEEKLY, TEST_WEEKLY);
|
if (TEST_WEEKLY) addVmOpt(b, SYSPROP_WEEKLY, TEST_WEEKLY);
|
||||||
if (TEST_MONSTER) addVmOpt(b, SYSPROP_MONSTER, TEST_MONSTER);
|
if (TEST_MONSTER) addVmOpt(b, SYSPROP_MONSTER, TEST_MONSTER);
|
||||||
|
|
Loading…
Reference in New Issue