reapStaleEnvironments static method

Future<void> reapStaleEnvironments()

Removes environments whose owning test process no longer exists.

Every up call registers its compose project in a state directory. A test process that is killed before docker compose down runs (debugger stop, SIGKILL, crash) leaves its containers behind; the next test run detects the dead owner process and removes the leftovers.

Runs once per isolate; subsequent calls await the first invocation.

Implementation

static Future<void> reapStaleEnvironments() =>
    _reapFuture ??= _reapStaleEnvironments();