Skip to content

Commit

Permalink
Improve test run error reporting for WebSocket (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlinsley authored Oct 8, 2024
1 parent a25800b commit a3e2b86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runner/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func connect(ctx context.Context, server *state.Server, globalCollectionOpts sta
if err != nil {
cancelConn()
logger.PrintWarning("Error starting websocket: %s %v", err, response)
server.SelfTest.MarkCollectionAspectError(state.CollectionAspectWebSocket, "error starting WebSocket: %s", err)
return
}
server.WebSocket.Store(conn)
Expand Down Expand Up @@ -117,7 +118,7 @@ func connect(ctx context.Context, server *state.Server, globalCollectionOpts sta
shutdown := errors.Is(err, net.ErrClosed) // The collector process is shutting down
if !serverClosed && !shutdown {
logger.PrintWarning("Error reading from websocket: %s", err)
server.SelfTest.MarkCollectionAspectError(state.CollectionAspectWebSocket, "error starting WebSocket: %s", err)
server.SelfTest.MarkCollectionAspectError(state.CollectionAspectWebSocket, "error reading from WebSocket: %s", err)
}
cancelConn()
return
Expand Down

0 comments on commit a3e2b86

Please sign in to comment.