Skip to content

Collect distributed coverage before stopping peers - #6

Closed
jeregrine wants to merge 1 commit into
mainfrom
fix/distributed-coverage
Closed

Collect distributed coverage before stopping peers#6
jeregrine wants to merge 1 commit into
mainfrom
fix/distributed-coverage

Conversation

@jeregrine

Copy link
Copy Markdown
Member

Problem

Coverage instrumentation changes the coordinator's compiled helper functions, but distributed peers load ordinary BEAM files. This causes remote badfun failures under mix test --cover. Peer execution is also absent from the report unless its counters are collected before the VM stops.

Fix

Enable distributed OTP coverage and attach each peer before starting Group. OTP loads the same instrumented modules on the peers, preserving anonymous-function compatibility and collecting their execution.

Route all peer shutdowns, including deliberate node-failure scenarios, through a coverage-aware helper that transfers counters before stopping the VM. Exclude support modules from the reported score and add a regression that checks retention of a peer-only call after shutdown.

Supporting information

The combined coverage report is approximately 84.7%, below Mix's unchanged default 90% threshold. Consequently, mix test --cover still exits nonzero for the coverage threshold, rather than remote execution failures. This change does not lower the threshold or conceal the coverage gap.

Abrupt VM crashes can still lose counters not yet collected; the deliberate shutdown helper collects them first.

@jeregrine
jeregrine force-pushed the fix/distributed-coverage branch from 81112f6 to 8bcfb12 Compare September 10, 2026 12:46
@jeregrine jeregrine closed this Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant