Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 8f780df

Browse files
committed
Update panic to log when cdp close fails
While testing for another change, it became apparent that the panic when working with browser.close() would prevent any of the remaining data directories from being cleaned up in the temporary directory. Instead of panicking, we're going to log an error and carry on with rest of the process to try and close the subprocess and eventually delete the data directory. This change does indeed bring about the behaviour we want even when the context has been closed.
1 parent bb18273 commit 8f780df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/browser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ func (b *Browser) Close() {
453453
var closeErr *websocket.CloseError
454454
err := cdpbrowser.Close().Do(cdp.WithExecutor(b.ctx, b.conn))
455455
if err != nil && !errors.As(err, &closeErr) {
456-
k6ext.Panic(b.ctx, "closing the browser: %v", err)
456+
b.logger.Errorf("Browser:Close", "closing the browser: %v", err)
457457
}
458458
}
459459

0 commit comments

Comments
 (0)