Skip to content

Commit

Permalink
set an error on the test run when we lose DTX connectivity
Browse files Browse the repository at this point in the history
in most coses this is due to the test runner crashing (or it can also be closed
manually through the UI)
  • Loading branch information
dmissmann committed Aug 1, 2024
1 parent 6cc0b7c commit 2147a10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ios/testmanagerd/testlistener.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ func (t *TestListener) TestRunnerKilled() {
t.executionFinished()
}

func (t *TestListener) FinishWithError(err error) {
t.err = err
t.executionFinished()
}

func (t *TestListener) Done() <-chan struct{} {
return t.finished
}
Expand Down
3 changes: 3 additions & 0 deletions ios/testmanagerd/xcuitestrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package testmanagerd

import (
"context"
"errors"
"fmt"
"io"
"path"
Expand Down Expand Up @@ -398,12 +399,14 @@ func runXUITestWithBundleIdsXcode15Ctx(
if conn1.Err() != dtx.ErrConnectionClosed {
log.WithError(conn1.Err()).Error("conn1 closed unexpectedly")
}
testListener.FinishWithError(errors.New("lost connection to testmanagerd. the test-runner may have been killed"))
break
case <-conn2.Closed():
log.Debug("conn2 closed")
if conn2.Err() != dtx.ErrConnectionClosed {
log.WithError(conn2.Err()).Error("conn2 closed unexpectedly")
}
testListener.FinishWithError(errors.New("lost connection to testmanagerd. the test-runner may have been killed"))
break
case <-testListener.Done():
break
Expand Down

0 comments on commit 2147a10

Please sign in to comment.