Skip to content

Commit fd8acfc

Browse files
authored
Add a timeout to the test method pop_response (#3727)
If the server doesn't prove a response, this blocks indefinitely. 20 seconds is quite long but I don't want to make it too short
1 parent ce5a9e5 commit fd8acfc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/ruby_lsp/base_server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def start
103103
# This method is only intended to be used in tests! Pops the latest response that would be sent to the client
104104
#: -> untyped
105105
def pop_response
106-
@outgoing_queue.pop
106+
@outgoing_queue.pop(timeout: 20) || raise("No message received from server")
107107
end
108108

109109
# This method is only intended to be used in tests! Pushes a message to the incoming queue directly

0 commit comments

Comments
 (0)