[clangd] Improve remote-index test
authorKirill Bobyrev <kbobyrev@google.com>
Mon, 2 Nov 2020 09:55:17 +0000 (10:55 +0100)
committerKirill Bobyrev <kbobyrev@google.com>
Mon, 2 Nov 2020 09:55:17 +0000 (10:55 +0100)
commitd0beda1b66617cda8a1f54978fca72832496b1fb
tree3708710b66813733aafb34e78382bba5c4c8cfb0
parent7706c3022ead52d49cf455df7e7c289a485aa6ec
[clangd] Improve remote-index test

Introduce a separate thread that will kill `clangd-index-server` after 10 seconds regardless. This helps shut down the test if the server hangs and `stderr.readline()` does not contain inititalizatiton message. It prevents "necessary" waiting delay for the server warm-up and only introduces additional delay if the test fails.

It also makes use of `subprocess.Popen.kill()` which is a portable way of handling process shutdown and avoids using signals.

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D90590
clang-tools-extra/clangd/test/remote-index/pipeline_helper.py