fix: report a user-requested stop as stopped rather than failed
Stopping a test shuts down the control socket, so iperf_run_client() returns -1 with "unable to send control message ... Broken pipe". That is the expected consequence of the stop, not a fault, but the bridge read the negative return as a failure — so pressing STOP left the UI showing "Error (exit 1)" above a broken-pipe message. The bridge now consults its own g_stop flag before classifying the outcome, and the distinction travels up as Iperf3Result.stopped so the status line can say "Stopped". A stop is reported with exit code 0: the run ended the way the user asked it to. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -166,7 +166,10 @@ class _TestRunContentState extends State<_TestRunContent> {
|
||||
final (String label, Color color) = switch (vm.state) {
|
||||
TestRunState.idle => ('Ready', scheme.onSurfaceVariant),
|
||||
TestRunState.running => ('Running…', scheme.primary),
|
||||
TestRunState.completed => ('Test complete', scheme.primary),
|
||||
TestRunState.completed => (
|
||||
vm.wasStopped ? 'Stopped' : 'Test complete',
|
||||
vm.wasStopped ? scheme.onSurfaceVariant : scheme.primary,
|
||||
),
|
||||
TestRunState.error => (
|
||||
'Error${vm.result != null ? ' (exit ${vm.result!.exitCode})' : ''}',
|
||||
scheme.error,
|
||||
|
||||
Reference in New Issue
Block a user