Skip to content

Commit 6b6084a

Browse files
committed
MESSAGE_POLL_TIMEOUT should be enough for extra conf and StartServer() to complete
This is a UT fixup for a change in _AwaitServerMessages. Note that #1434 (comment) is not exactly correct together with #1434. Quote: > (...) Note that the java completer has a ton of setup to do before it gets to the super().StartServer(). It's true that it has some additional tasks (wiping out workspace) before it calls *super()._StartServerNoLock()*. But PR 1434 doesn't address it - wiping workspace is called from JavaCompleter.StartServer() at which point _server_started is already True, so the following part from that PR in _AwaitServerMessages(): -return self._initialize_event.is_set() +return not self._server_started or self._initialize_event.is_set() did not make it return True. In other words, #1434 seems to not address the JavaCompleter issue, but only the issue with potentially long extra conf Settings(). However according to #1433 (comment) this should rather be solved by increasing MESSAGE_POLL_TIMEOUT. Anyway, one of the first things we do from OnFileReadyToParse() when server is not healthy is setting _server_started to True.
1 parent 89ed4cf commit 6b6084a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ycmd/tests/language_server/language_server_completer_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,11 +1482,11 @@ def test_LanguageServerCompleter_Diagnostics_PercentEncodeCannonical(
14821482

14831483
@IsolatedYcmd()
14841484
@patch.object( completer, 'MESSAGE_POLL_TIMEOUT', 0.01 )
1485-
def test_LanguageServerCompleter_PollForMessages_ServerNotStarted(
1485+
def test_LanguageServerCompleter_PollForMessages_ServerStartTooLong(
14861486
self, app ):
14871487
server = MockCompleter()
14881488
request_data = RequestWrap( BuildRequest() )
1489-
assert_that( server.PollForMessages( request_data ), equal_to( True ) )
1489+
assert_that( server.PollForMessages( request_data ), equal_to( False ) )
14901490

14911491

14921492
@IsolatedYcmd()

0 commit comments

Comments
 (0)