Muex.WorkerPool
(Muex v0.6.1)
View Source
Manages a pool of workers for parallel mutation testing across all files.
Uses a global queue of mutations with per-file locking to maximize
cross-file parallelism while preventing concurrent modifications to the
same source file. Each worker operates in an isolated sandbox directory
so that parallel mix test invocations don't see each other's mutations.
Scheduling strategy
When a worker slot becomes available, the pool picks the next mutation from any file that is not currently locked. This means mutations targeting different files run in true parallel, while mutations targeting the same file are serialized.
Summary
Functions
Returns a specification to start this module under a supervisor.
Restores any source files left in a mutated state from a previous interrupted run.
Checks for .backup files and replaces the originals.
Runs all mutations through the worker pool.
Starts the worker pool.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Restores any source files left in a mutated state from a previous interrupted run.
Checks for .backup files and replaces the originals.
@spec run_mutations( pid(), [map()], %{required(Path.t()) => map()}, module(), map(), map(), keyword() ) :: [map()]
Runs all mutations through the worker pool.
Accepts the full set of mutations across all files. Mutations targeting
different files run in parallel (up to max_workers); mutations targeting
the same file are serialized automatically.
Parameters
pool- The worker pool PIDmutations- List of all mutations to test (across all files)file_entries- Map of file paths to file entry mapslanguage_adapter- The language adapter moduledependency_map- Map of modules to test filesfile_to_module- Map of file paths to module namesopts- Options including:timeout_ms,:test_paths,:verbose
Returns
List of mutation results.
Starts the worker pool.
Options
:max_workers- Maximum concurrent workers (default: 4)