Mash tool: dispose transport before awaiting the link on shutdown
On a wedged (fully silent) board the receive loop sits in a pending net48 serial read that ignores cancellation; awaiting the link before closing the port hangs the tool at run end and loses the summary - exactly what happened on the first real baseline run (the board wedged at 0.62s and stayed dead, so no byte ever completed the read). Close the port first (same order RioCoordinator.Teardown uses); applies to both monitor and --mash modes. Selftest unaffected (its fake transport honors cancellation, which is why it never caught this). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -148,9 +148,11 @@ Log(">>> NOW: press the MFD buttons, press keypad keys, and move the axis <<<");
|
||||
Log(">>> a pressed button should light up <<<");
|
||||
|
||||
await Task.Delay(TimeSpan.FromSeconds(seconds));
|
||||
// Transport first: a silent board leaves the receive loop in a pending read
|
||||
// that only the port close unblocks (net48 ReadAsync ignores cancellation).
|
||||
cts.Cancel();
|
||||
try { await run; } catch { /* shutdown */ }
|
||||
transport.Dispose();
|
||||
try { await run; } catch { /* shutdown */ }
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("== summary ==");
|
||||
|
||||
Reference in New Issue
Block a user