Skip to content

Commit 5f6edc8

Browse files
committed
Fix SSL Test Failure due to time delays in SSL initialization
Due to time delays between SSL context initialization at the server and and the client program exiting too soon, the SSL tests were failing. The failure happens due to: Required condition was not found: [Output match: Connected to a server] As the client did not connect to the server as expected. This fix reads the jitserver verbose log to confirm if the SSL context is initialized before starting the client. Closes: ##18308 Signed-off-by: SajinaKandy <[email protected]>
1 parent 59eb37d commit 5f6edc8

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

test/functional/cmdLineTests/jitserver/jitserverArgumentTesting.xml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
<variable name="JITSERVER_SSL1" value="-XX:JITServerSSLRootCerts=cert.pem" />
3030
<variable name="JITSERVER_SSL2" value="-XX:JITServerSSLRootCerts=wrongCert.pem" />
3131
<variable name="JITSERVER_SSL3" value="-XX:JITServerSSLRootCerts=nosslserverCert.pem" />
32-
<variable name="JITSERVER_VERBOSE" value="-Xjit:verbose={JITServer},verbose={JITServerConns},verbose={compilePerformance}" />
32+
<variable name="JITSERVER_CLIENT_OPTS" value="-Xjit:count=0,verbose={JITServer},verbose={JITServerConns},verbose={compilePerformance}" />
33+
<variable name="NO_LOCAL_SYNC_COMPILE" value="-XX:-JITServerLocalSyncCompiles" />
3334
<variable name="DEFAULT_JITSERVER_OPTIONS" value="-Xjit" />
3435

3536
<test id="Test default configuration">
36-
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_VERBOSE$" false</command>
37+
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_CLIENT_OPTS$ $NO_LOCAL_SYNC_COMPILE$" false</command>
3738
<output type="success" caseSensitive="no" regex="yes" javaUtilPattern="yes">(java|openjdk|semeru) version</output>
3839
<output type="required" caseSensitive="no" regex="no">JITServer Client Mode.</output>
3940
<output type="success" caseSensitive="no" regex="no">Connected to a server</output>
@@ -45,7 +46,7 @@
4546
</test>
4647

4748
<test id="Test JITServer disabled">
48-
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$DISABLE_JITSERVER$ $JITSERVER_VERBOSE$" false</command>
49+
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$DISABLE_JITSERVER$ $JITSERVER_CLIENT_OPTS$ $NO_LOCAL_SYNC_COMPILE$" false</command>
4950
<output type="success" caseSensitive="no" regex="yes" javaUtilPattern="yes">(java|openjdk|semeru) version</output>
5051
<output type="failure" caseSesnsitive="no" regex="no">Connected to a server</output>
5152
<output type="failure" caseSensitive="no" regex="yes" javaUtilPattern="yes">(Fatal|Unhandled) Exception</output>
@@ -56,7 +57,7 @@
5657
</test>
5758

5859
<test id="Test bad port">
59-
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_VERBOSE$ -XX:JITServerPort=38399" false</command>
60+
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_CLIENT_OPTS$ $NO_LOCAL_SYNC_COMPILE$ -XX:JITServerPort=38399" false</command>
6061
<output type="success" caseSensitive="no" regex="yes" javaUtilPattern="yes">(java|openjdk|semeru) version</output>
6162
<output type="failure" caseSesnsitive="no" regex="no">Connected to a server</output>
6263
<output type="failure" caseSensitive="no" regex="yes" javaUtilPattern="yes">(Fatal|Unhandled) Exception</output>
@@ -67,7 +68,7 @@
6768
</test>
6869

6970
<test id="Test bad hostname">
70-
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_VERBOSE$ -XX:JITServerAddress=bad.address" false</command>
71+
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_CLIENT_OPTS$ $NO_LOCAL_SYNC_COMPILE$ -XX:JITServerAddress=bad.address" false</command>
7172
<output type="success" caseSensitive="no" regex="yes" javaUtilPattern="yes">(java|openjdk|semeru) version</output>
7273
<output type="failure" caseSesnsitive="no" regex="no">Connected to a server</output>
7374
<output type="failure" caseSensitive="no" regex="yes" javaUtilPattern="yes">(Fatal|Unhandled) Exception</output>
@@ -78,7 +79,7 @@
7879
</test>
7980

8081
<test id="Test Metrics">
81-
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_VERBOSE$" true</command>
82+
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_CLIENT_OPTS$ $NO_LOCAL_SYNC_COMPILE$" true</command>
8283
<output type="required" caseSensitive="no" regex="yes" javaUtilPattern="yes">(java|openjdk|semeru) version</output>
8384
<output type="success" caseSensitive="no" regex="no">jitserver_cpu_utilization</output>
8485
<output type="success" caseSensitive="no" regex="no">jitserver_available_memory</output>
@@ -93,12 +94,12 @@
9394
</test>
9495

9596
<test id="Test SSL success condition">
96-
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_VERBOSE$ $JITSERVER_SSL1$" false</command>
97+
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_CLIENT_OPTS$ $NO_LOCAL_SYNC_COMPILE$ $JITSERVER_SSL1$" false</command>
9798
<output type="success" caseSensitive="no" regex="yes" javaUtilPattern="yes">(java|openjdk|semeru) version</output>
9899
<output type="required" caseSensitive="no" regex="no">JITServer Client Mode.</output>
99100
<output type="success" caseSensitive="no" regex="no">Successfully initialized SSL context</output>
100-
<output type="success" caseSensitive="no" regex="no">SSL connection on socket</output>
101-
<output type="required" caseSensitive="no" regex="no">Connected to a server</output>
101+
<output type="required" caseSensitive="no" regex="no">SSL connection on socket</output>
102+
<output type="success" caseSensitive="no" regex="no">Connected to a server</output>
102103
<output type="failure" caseSensitive="no" regex="yes" javaUtilPattern="yes">(Fatal|Unhandled) Exception</output>
103104
<output type="success" caseSensitive="yes" regex="no">JITSERVER EXISTS</output>
104105
<output type="success" caseSensitive="yes" regex="no">JITSERVER STILL EXISTS</output>
@@ -107,7 +108,7 @@
107108
</test>
108109

109110
<test id="Test SSL Failure Case with mismatched certificate">
110-
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_VERBOSE$ $JITSERVER_SSL2$" false</command>
111+
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_CLIENT_OPTS$ $NO_LOCAL_SYNC_COMPILE$ $JITSERVER_SSL2$" false</command>
111112
<output type="success" caseSensitive="no" regex="yes" javaUtilPattern="yes">(java|openjdk|semeru) version</output>
112113
<output type="required" caseSensitive="no" regex="no">JITServer Client Mode.</output>
113114
<output type="success" caseSensitive="no" regex="no">Successfully initialized SSL context</output>
@@ -121,7 +122,7 @@
121122
</test>
122123

123124
<test id="Test SSL Failure Case with connection to Non-SSL Server">
124-
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_VERBOSE$ $JITSERVER_SSL3$" false</command>
125+
<command>bash $SCRIPPATH$ $TEST_RESROOT$ $TEST_JDK_BIN$ "$DEFAULT_JITSERVER_OPTIONS$" "$ENABLE_JITSERVER$ $JITSERVER_CLIENT_OPTS$ $NO_LOCAL_SYNC_COMPILE$ $JITSERVER_SSL3$" false</command>
125126
<output type="success" caseSensitive="no" regex="yes" javaUtilPattern="yes">(java|openjdk|semeru) version</output>
126127
<output type="required" caseSensitive="no" regex="no">JITServer Client Mode.</output>
127128
<output type="success" caseSensitive="no" regex="no">Successfully initialized SSL context</output>

0 commit comments

Comments
 (0)