Skip to content

Commit 991776f

Browse files
authored
Merge pull request #278 from eclipse-rcptt/merge/master/release/2.8
Merge release/2.8 into master
2 parents 805de42 + fa4aa4f commit 991776f

1 file changed

Lines changed: 23 additions & 20 deletions

File tree

launching/tests/org.eclipse.rcptt.launching.ext.tests/src/org/eclipse/rcptt/launching/ext/Q7ExternalLaunchDelegateTest.java

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -143,32 +143,35 @@ public void surviveRestart() throws InterruptedException, CoreException, IOExcep
143143
AutLaunch launch = startAut(installDir, List.of("-consoleLog"));
144144
launch.ping();
145145
Command command = parse("restart-aut");
146-
launch.execute(command);
147-
for (long stop = currentTimeMillis() + 100_000; currentTimeMillis() < stop; ) {
148-
try {
149-
launch.ping();
150-
Thread.yield();
151-
} catch (CoreException e) {
152-
break;
146+
int attemptCount = Integer.getInteger(Q7ExternalLaunchDelegateTest.class.getName() + ".restartAttempts", 3);
147+
for (int i = 0; i < attemptCount; i++) {
148+
launch.execute(command);
149+
for (long stop = currentTimeMillis() + 100_000; currentTimeMillis() < stop; ) {
150+
try {
151+
launch.ping();
152+
Thread.yield();
153+
} catch (CoreException e) {
154+
break;
155+
}
153156
}
154-
}
155-
156-
try {
157-
launch.ping();
158-
fail("AUT should be temporarily unavailable");
159-
} catch (CoreException e) {
160-
}
161-
162-
for (long stop = currentTimeMillis() + 200_000; currentTimeMillis() < stop; ) {
157+
163158
try {
164159
launch.ping();
165-
Thread.yield();
166-
break;
160+
fail("AUT should be temporarily unavailable");
167161
} catch (CoreException e) {
168-
// Expected for a while
169162
}
163+
164+
for (long stop = currentTimeMillis() + 200_000; currentTimeMillis() < stop; ) {
165+
try {
166+
launch.ping();
167+
Thread.yield();
168+
break;
169+
} catch (CoreException e) {
170+
// Expected for a while
171+
}
172+
}
173+
launch.ping();
170174
}
171-
launch.ping();
172175
assertNoErrorsInOutput();
173176
}
174177

0 commit comments

Comments
 (0)