Skip to content

Commit f26c27b

Browse files
committed
Fix #11885: Avoid non-determinism of idempotency tests on Windows
The cause of the problem is that we use parallelism in Pickler: if !Pickler.ParallelPickling || ctx.settings.YtestPickler.value then force() Sometimes on Windows, the futures run a little slower, and the later phase `Inlining` can change the positions of the trees to be pickled, thus non-determinism.
1 parent f01c14d commit f26c27b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/Run.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
185185

186186
// If testing pickler, make sure to stop after pickling phase:
187187
val stopAfter =
188-
if (ctx.settings.YtestPickler.value) List("pickler")
188+
if (ctx.settings.YtestPickler.value) List()
189189
else ctx.settings.YstopAfter.value
190190

191191
val pluginPlan = ctx.base.addPluginPhases(ctx.base.phasePlan)

compiler/test/dotty/tools/dotc/IdempotencyTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class IdempotencyTests {
2121
@Category(Array(classOf[SlowTests]))
2222
@Test def idempotency: Unit = {
2323
implicit val testGroup: TestGroup = TestGroup("idempotency")
24-
val opt = defaultOptions
24+
val opt = defaultOptions.and("-Ytest-pickler")
2525

2626
val posIdempotency = aggregateTests(
2727
compileFilesInDir("tests/pos", opt)(TestGroup("idempotency/posIdempotency1")),

0 commit comments

Comments
 (0)