discardPeerRun function
Drops the shared handoff state without finishing the run.
The process that owns the finish calls it so the next suite run starts from a clean slate instead of attaching to the run it just closed.
Implementation
void discardPeerRun(
int projectId,
String runTitle, {
Map<String, String>? env,
}) {
final paths = handoffPaths(projectId, runTitle, env);
try {
if (!File(paths.idPath).existsSync()) return;
} on IOException {
return;
}
if (!acquireHandoffLock(paths.lockPath, const Duration(seconds: 60))) {
logDebug('Tracera: timed out waiting for handoff lock ${paths.lockPath}');
return;
}
try {
_tryDeleteFile(paths.idPath);
} finally {
releaseHandoffLock(paths.lockPath);
}
}