TLDR
Regression since Mill 1.0.3: Mill calls runner.tasks(...) during scheduler pre-filtering in the Mill/Zinc worker, before the forked test JVM is launched. For Weaver, runner.tasks(...) initializes GlobalResource, so forkEnv is not visible there.
Then the queue scheduler calls runner.tasks(...) one claimed class at a time, so Weaver's GlobalResource TaskDef and resource-using suite TaskDef are split apart.
Minimal repro: https://github.com/nguyenyou/mill-weaver-forkenv-global-resource-repro
Root Cause
Current path:
TestModuleUtil.runTests
|
|-- ZincOp.GetTestTasks
| |
| `-- TestRunnerUtils.getTestTasks0
| |
| `-- runner.tasks(...) // runs in Mill/Zinc worker, no forkEnv
|
`-- forked test JVM
|
`-- queue scheduler calls runner.tasks([one claimed class])
For most frameworks, runner.tasks(...) is effectively cheap task materialization. For Weaver, it is semantically meaningful: global resources are collected and initialized from the full TaskDef batch.
So there are two related scheduler issues:
runner.tasks(...) runs outside the forked JVM, so framework setup cannot see forkEnv.
- The queue scheduler splits related
TaskDefs, so Weaver sees the suite without the global resource.
Regression / Affected Versions
Bisect points to:
First affected stable release: Mill 1.0.3
Affected:
1.0.3+
- all current
1.1.x releases, including 1.1.5
Not affected:
0.12.x
1.0.0 through 1.0.2
User report: 0.12.16 works, 1.1.5 fails.
Expected
Framework setup and TaskDef batching should happen inside the forked test JVM with forkEnv applied, or Mill should preserve full selected TaskDef batch semantics for frameworks that require it.
Actual
Mill pre-filters by invoking framework task creation in a worker without forkEnv, then the forked queue runner invokes framework task creation per claimed class.
TLDR
Regression since Mill 1.0.3: Mill calls
runner.tasks(...)during scheduler pre-filtering in the Mill/Zinc worker, before the forked test JVM is launched. For Weaver,runner.tasks(...)initializesGlobalResource, soforkEnvis not visible there.Then the queue scheduler calls
runner.tasks(...)one claimed class at a time, so Weaver'sGlobalResourceTaskDefand resource-using suiteTaskDefare split apart.Minimal repro: https://github.com/nguyenyou/mill-weaver-forkenv-global-resource-repro
Root Cause
Current path:
For most frameworks,
runner.tasks(...)is effectively cheap task materialization. For Weaver, it is semantically meaningful: global resources are collected and initialized from the fullTaskDefbatch.So there are two related scheduler issues:
runner.tasks(...)runs outside the forked JVM, so framework setup cannot seeforkEnv.TaskDefs, so Weaver sees the suite without the global resource.Regression / Affected Versions
Bisect points to:
TestModuleUtil#runTestDefaultcode path intorunTestQueueScheduler#5630628e766d2d1085846ee5b6447199da97edeaaa0aConsolidate old TestModuleUtil#runTestDefault code path into runTestQueueSchedulerFirst affected stable release: Mill 1.0.3
Affected:
1.0.3+1.1.xreleases, including1.1.5Not affected:
0.12.x1.0.0through1.0.2User report:
0.12.16works,1.1.5fails.Expected
Framework setup and
TaskDefbatching should happen inside the forked test JVM withforkEnvapplied, or Mill should preserve full selectedTaskDefbatch semantics for frameworks that require it.Actual
Mill pre-filters by invoking framework task creation in a worker without
forkEnv, then the forked queue runner invokes framework task creation per claimed class.