Provide a MILL_TEST_FREE_PORT
environment variable for tests to use (500USD Bounty)
#3802
Labels
MILL_TEST_FREE_PORT
environment variable for tests to use (500USD Bounty)
#3802
From the maintainer Li Haoyi: I'm putting a 500USD bounty on this issue, payable by bank transfer on a merged PR implementing this.
Currently Mill's parallelism causes problems for test suites which need to spin up servers on localhost ports. Because different test suites may run in different tasks and subprocesses, coordinating across them to find free ports is annoying.
The Mill example test suite and the Cask example test suite just manually assigns the different web-server-related tests unique ports, but it is error-prone and should be automated
We may need to support a configurable number of unique ports (comma separated?) for test suites that need to spawn multiple services. Maybe we can annotate tasks with
Task(freePorts = n)
to mark them as needing free ports, like how we dopersistent = true
, and then Mill can assign those tasks ports starting from some base number (e.g.9000
) via the environment variableThe end result is that Mill's own
example
suite can remove all hardcoded ports and replace them with usages of theMILL_TEST_FREE_PORT
environment variableThe text was updated successfully, but these errors were encountered: