aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/client/session.lua6
-rw-r--r--test/functional/helpers.lua7
-rw-r--r--test/unit/helpers.lua1
3 files changed, 14 insertions, 0 deletions
diff --git a/test/client/session.lua b/test/client/session.lua
index 0509fa88be..b1bf5ea75e 100644
--- a/test/client/session.lua
+++ b/test/client/session.lua
@@ -73,6 +73,11 @@ function Session:next_message(timeout)
return table.remove(self._pending_messages, 1)
end
+ -- if closed, only return pending messages
+ if self.closed then
+ return nil
+ end
+
self:_run(on_request, on_notification, timeout)
return table.remove(self._pending_messages, 1)
end
@@ -139,6 +144,7 @@ function Session:close(signal)
if not self._timer:is_closing() then self._timer:close() end
if not self._prepare:is_closing() then self._prepare:close() end
self._msgpack_rpc_stream:close(signal)
+ self.closed = true
end
function Session:_yielding_request(method, args)
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 67275b12a4..b98cf97e7e 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -83,6 +83,13 @@ end
local session, loop_running, last_error, method_error
+if not is_os('win') then
+ local sigpipe_handler = luv.new_signal()
+ luv.signal_start(sigpipe_handler, "sigpipe", function()
+ print("warning: got SIGPIPE signal. Likely related to a crash in nvim")
+ end)
+end
+
function module.get_session()
return session
end
diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua
index 52769cd9e9..e9b97266d0 100644
--- a/test/unit/helpers.lua
+++ b/test/unit/helpers.lua
@@ -139,6 +139,7 @@ local function filter_complex_blocks(body)
or string.find(line, "_Float")
or string.find(line, "msgpack_zone_push_finalizer")
or string.find(line, "msgpack_unpacker_reserve_buffer")
+ or string.find(line, "value_init_")
or string.find(line, "UUID_NULL") -- static const uuid_t UUID_NULL = {...}
or string.find(line, "inline _Bool")) then
result[#result + 1] = line