Skip to content

Commit cea13c5

Browse files
authored
Merge pull request #1044 from turkeylurkey/issue-1043
Wait up to 60s for Java diagnostic to appear
2 parents edce25c + db3387b commit cea13c5

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/test/java/io/openliberty/tools/intellij/it/SingleModMPLSTestCommon.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,20 @@ public void testMPDiagnosticsInJavaPart() {
118118
try {
119119
// validate @Liveness no longer found in java part
120120
TestUtils.validateStringNotInFile(pathToSrc.toString(), livenessString);
121-
122-
//there should be a diagnostic - move cursor to hover point
123-
UIBotTestUtils.hoverInAppServerCfgFile(remoteRobot, flaggedString, "ServiceLiveHealthCheck.java", UIBotTestUtils.PopupType.DIAGNOSTIC);
124-
125-
String foundHoverData = UIBotTestUtils.getHoverStringData(remoteRobot, UIBotTestUtils.PopupType.DIAGNOSTIC);
121+
TestUtils.sleepAndIgnoreException(1);
122+
123+
String foundHoverData = null;
124+
int maxWait = 60, delay = 5; // in some cases it can take 35s for the diagnostic to appear
125+
for (int i = 0; i <= maxWait; i += delay) {
126+
//there should be a diagnostic - move cursor to hover point
127+
UIBotTestUtils.hoverInAppServerCfgFile(remoteRobot, flaggedString, "ServiceLiveHealthCheck.java", UIBotTestUtils.PopupType.DIAGNOSTIC);
128+
129+
foundHoverData = UIBotTestUtils.getHoverStringData(remoteRobot, UIBotTestUtils.PopupType.DIAGNOSTIC);
130+
if (!foundHoverData.isBlank()) {
131+
break;
132+
}
133+
TestUtils.sleepAndIgnoreException(delay);
134+
}
126135
TestUtils.validateHoverData(expectedHoverData, foundHoverData);
127136

128137
} finally {

0 commit comments

Comments
 (0)