File: 0008-Fix-java-restart-server-tests-to-wait-long-enough.patch

package info (click to toggle)
ycmd 0%2B20240823%2Bgit8b61f19%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,464 kB
  • sloc: python: 43,993; cpp: 6,138; java: 486; sh: 378; cs: 207; javascript: 150; ansic: 82; makefile: 45; xml: 18; objc: 10
file content (78 lines) | stat: -rw-r--r-- 2,936 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From dab4ad4c383f6f6ed76aeca98ca19aa3b93d6872 Mon Sep 17 00:00:00 2001
From: Ben Jackson <puremourning@gmail.com>
Date: Fri, 13 Dec 2024 15:59:02 +0000
Subject: [PATCH] Fix java restart server tests to wait long enough

---
 ycmd/tests/java/__init__.py               |  4 ++++
 ycmd/tests/java/server_management_test.py | 12 ++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/ycmd/tests/java/__init__.py b/ycmd/tests/java/__init__.py
index 5bdfc2df..09b9bff3 100644
--- a/ycmd/tests/java/__init__.py
+++ b/ycmd/tests/java/__init__.py
@@ -62,6 +62,10 @@ def StartJavaCompleterServerWithFile( app, file_path ):
                    event_name = 'FileReadyToParse',
                    filepath = file_path,
                    filetype = 'java' ) )
+  WaitUntilJavaCompleterServerReady( app )
+
+
+def WaitUntilJavaCompleterServerReady( app ):
   WaitUntilCompleterServerReady( app, 'java', SERVER_STARTUP_TIMEOUT )
 
 
diff --git a/ycmd/tests/java/server_management_test.py b/ycmd/tests/java/server_management_test.py
index 87700424..9cc871dd 100644
--- a/ycmd/tests/java/server_management_test.py
+++ b/ycmd/tests/java/server_management_test.py
@@ -36,15 +36,15 @@ from ycmd.tests.java import ( PathToTestFile,
                               isolated_app,
                               IsolatedYcmd,
                               StartJavaCompleterServerInDirectory,
-                              StartJavaCompleterServerWithFile )
+                              StartJavaCompleterServerWithFile,
+                              WaitUntilJavaCompleterServerReady )
 from ycmd.tests.test_utils import ( BuildRequest,
                                     CompleterProjectDirectoryMatcher,
                                     LocationMatcher,
                                     MockProcessTerminationTimingOut,
                                     RangeMatcher,
                                     TemporaryTestDir,
-                                    WaitForDiagnosticsToBeReady,
-                                    WaitUntilCompleterServerReady )
+                                    WaitForDiagnosticsToBeReady )
 from ycmd import utils, handlers
 
 
@@ -104,7 +104,7 @@ class ServerManagementTest( TestCase ):
       ),
     )
 
-    WaitUntilCompleterServerReady( app, 'java' )
+    WaitUntilJavaCompleterServerReady( app )
 
     app.post_json(
       '/event_notification',
@@ -147,7 +147,7 @@ class ServerManagementTest( TestCase ):
           ),
         )
 
-        WaitUntilCompleterServerReady( app, 'java' )
+        WaitUntilJavaCompleterServerReady( app )
 
         assert_that(
           app.post_json( '/debug_info',
@@ -197,7 +197,7 @@ class ServerManagementTest( TestCase ):
           ),
         )
 
-        WaitUntilCompleterServerReady( app, 'java' )
+        WaitUntilJavaCompleterServerReady( app )
 
         assert_that(
           app.post_json( '/debug_info',
-- 
2.45.2