diff --git a/arduino/monitor/monitor_test.go b/arduino/monitor/monitor_test.go
index 0ccae7f7fe0..cf45771c4b1 100644
--- a/arduino/monitor/monitor_test.go
+++ b/arduino/monitor/monitor_test.go
@@ -74,13 +74,13 @@ func TestDummyMonitor(t *testing.T) {
 	go func() {
 		buff := [1024]byte{}
 		// Receive "TEST" echoed back
-		n, err = rw.Read(buff[:])
+		_, err := rw.Read(buff[:])
 		require.NoError(t, err)
 		require.Equal(t, 4, n)
 		require.Equal(t, "TEST", string(buff[:4]))
 
 		// Block on read until the port is closed
-		n, err = rw.Read(buff[:])
+		_, err = rw.Read(buff[:])
 		require.ErrorIs(t, err, io.EOF)
 		atomic.StoreInt32(&completed, 1) // notify completion
 	}()
diff --git a/executils/process.go b/executils/process.go
index 08e5e626052..6044275af85 100644
--- a/executils/process.go
+++ b/executils/process.go
@@ -160,6 +160,9 @@ func (p *Process) SetEnvironment(values []string) {
 // RunWithinContext starts the specified command and waits for it to complete. If the given context
 // is canceled before the normal process termination, the process is killed.
 func (p *Process) RunWithinContext(ctx context.Context) error {
+	if err := p.Start(); err != nil {
+		return err
+	}
 	completed := make(chan struct{})
 	defer close(completed)
 	go func() {
@@ -169,6 +172,5 @@ func (p *Process) RunWithinContext(ctx context.Context) error {
 		case <-completed:
 		}
 	}()
-	res := p.cmd.Run()
-	return res
+	return p.Wait()
 }