mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-03 03:27:10 +00:00
fix(runner): surface clear message on WDA connection drop
This commit is contained in:
1 parent
f05bdbd0ba
commit
788dd94bc5
1 file changed
+10
@@ -6,6 +6,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
@@ -192,6 +193,9 @@ func Run(ctx context.Context, options Options) (Summary, error) {
|
|||||||
|
|
||||||
if nextErr == nil {
|
if nextErr == nil {
|
||||||
if err := applyAction(ctx, options.Driver, nextAction, tree); err != nil {
|
if err := applyAction(ctx, options.Driver, nextAction, tree); err != nil {
|
||||||
|
if isWDADrop(err) {
|
||||||
|
return summary, fmt.Errorf("step %d: iOS XCTest runner lost connection - known WDA startup flake, re-run the test: %w", stepIndex, err)
|
||||||
|
}
|
||||||
return summary, fmt.Errorf("step %d apply: %w", stepIndex, err)
|
return summary, fmt.Errorf("step %d apply: %w", stepIndex, err)
|
||||||
}
|
}
|
||||||
actionCopy := nextAction
|
actionCopy := nextAction
|
||||||
@@ -500,6 +504,12 @@ func encodeResiduals(residuals map[string]ltl.Formula) (map[string]json.RawMessa
|
|||||||
return encoded, firstErr
|
return encoded, firstErr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isWDADrop(err error) bool {
|
||||||
|
msg := err.Error()
|
||||||
|
return strings.Contains(msg, "ConnectException") ||
|
||||||
|
(strings.Contains(msg, "code = Internal") && strings.Contains(msg, "SocketException"))
|
||||||
|
}
|
||||||
|
|
||||||
func traceExceptions(exceptions []verifier.Exception) []trace.Exception {
|
func traceExceptions(exceptions []verifier.Exception) []trace.Exception {
|
||||||
if len(exceptions) == 0 {
|
if len(exceptions) == 0 {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in new issue
Block a user