Skip to content

Commit 54d6672

Browse files
authored
Merge pull request #154 from bnbarham/6.1-wait-for-exit
[6.1][test-sourcekit-lsp] Use `communicate` to wait for subprocess to exit
2 parents 65f7d50 + 306595c commit 54d6672

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test-sourcekit-lsp/test-sourcekit-lsp.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ def wait_for_exit(self, timeout: int) -> int:
108108
"""
109109
Wait for the LSP server to terminate.
110110
"""
111-
return self.process.wait(timeout)
111+
stdout, stderr = self.process.communicate(timeout=timeout)
112+
print("stdout before exit")
113+
print(stdout)
114+
print("stderr before exit")
115+
print(stderr)
116+
return self.process.returncode
112117

113118

114119
def main():
@@ -225,7 +230,7 @@ def main():
225230
connection.send_request("shutdown", {})
226231
connection.send_notification("exit", {})
227232

228-
return_code = connection.wait_for_exit(timeout=1)
233+
return_code = connection.wait_for_exit(timeout=5)
229234
if return_code == 0:
230235
print("OK")
231236
else:

0 commit comments

Comments
 (0)