From a3e2b86444eebc28ba10bba383f6ef0da832bb53 Mon Sep 17 00:00:00 2001 From: Sean Linsley Date: Tue, 8 Oct 2024 09:44:42 -0500 Subject: [PATCH] Improve test run error reporting for WebSocket (#608) --- runner/websocket.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runner/websocket.go b/runner/websocket.go index b1aef6c6c..3add6feb8 100644 --- a/runner/websocket.go +++ b/runner/websocket.go @@ -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) @@ -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