From 700a25e6218e016b5adb0ddee740be4618d717a2 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 3 Jan 2025 18:39:42 +0100 Subject: test: include stderr in EOF failure message --- test/client/session.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test/client/session.lua') diff --git a/test/client/session.lua b/test/client/session.lua index 5b7f1a7caa..a5839e012a 100644 --- a/test/client/session.lua +++ b/test/client/session.lua @@ -12,10 +12,8 @@ local RpcStream = require('test.client.rpc_stream') --- @field private _rpc_stream test.RpcStream --- @field private _prepare uv.uv_prepare_t --- @field private _timer uv.uv_timer_t ---- @field exec_lua_setup boolean --- @field private _is_running boolean true during `Session:run()` scope. ---- @field private _stdout_buffer string[] Stores stdout chunks ---- @field public stdout string Full stdout after the process exits +--- @field exec_lua_setup boolean local Session = {} Session.__index = Session if package.loaded['jit'] then @@ -231,7 +229,13 @@ function Session:_run(request_cb, notification_cb, timeout) end self._rpc_stream:read_start(request_cb, notification_cb, function() uv.stop() - self.eof_err = { 1, 'EOF was received from Nvim. Likely the Nvim process crashed.' } + + --- @diagnostic disable-next-line: invisible + local stderr = self._rpc_stream._stream.stderr --[[@as string?]] + -- See if `ProcStream.stderr` has anything useful. + stderr = '' ~= ((stderr or ''):match('^%s*(.*%S)') or '') and ' stderr:\n' .. stderr or '' + + self.eof_err = { 1, 'EOF was received from Nvim. Likely the Nvim process crashed.' .. stderr } end) uv.run() self._prepare:stop() -- cgit