Skip to content

Commit 10f66bd

Browse files
committed
wip
Signed-off-by: Edward Liang <[email protected]>
1 parent f57543c commit 10f66bd

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

java/integTest/src/test/java/glide/standalone/CommandTests.java

+25-3
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ public void scriptFlush(GlideClient regularClient) {
17001700
script.close();
17011701
}
17021702

1703-
@Disabled("flaky test: re-enable once fixed")
1703+
// @Disabled("flaky test: re-enable once fixed")
17041704
@ParameterizedTest
17051705
@MethodSource("getClients")
17061706
@SneakyThrows
@@ -1724,19 +1724,41 @@ public void scriptKill(GlideClient regularClient) {
17241724
try (var testClient =
17251725
GlideClient.createClient(commonClientConfig().requestTimeout(10000).build()).get()) {
17261726
try {
1727-
testClient.invokeScript(script);
1727+
// testClient.invokeScript(script);
17281728

17291729
Thread.sleep(1000);
17301730

17311731
// Run script kill until it returns OK
17321732
boolean scriptKilled = false;
17331733
int timeout = 4000; // ms
1734+
boolean first = true;
17341735
while (timeout >= 0) {
17351736
try {
1736-
assertEquals(OK, regularClient.scriptKill().get());
1737+
if (first) {
1738+
throw new ExecutionException(new RequestException("Hello!"));
1739+
// assertEquals(OK, OK);
1740+
} else {
1741+
System.out.println("Trying to kill script now");
1742+
assertEquals(OK, regularClient.scriptKill().get());
1743+
System.out.println("We did it");
1744+
}
17371745
scriptKilled = true;
17381746
break;
17391747
} catch (RequestException ignored) {
1748+
} catch (ExecutionException exception) {
1749+
// If exception says no scripts in execution right now, rerun script.
1750+
System.out.println("caught the exception");
1751+
if (exception.getCause() instanceof RequestException &&
1752+
executionException
1753+
.getMessage()
1754+
.toLowerCase()
1755+
.contains("no scripts in execution right now")) {
1756+
testClient.invokeScript(script);
1757+
timeout = 4000; // TODO: see if this is a good idea or not
1758+
System.out.println("Printed!!");
1759+
first = false;
1760+
Thread.sleep(1000);
1761+
}
17401762
}
17411763
Thread.sleep(500);
17421764
timeout -= 500;

0 commit comments

Comments
 (0)