Skip to content

Commit 5762571

Browse files
committed
(wip) cleaned up
Signed-off-by: Edward Liang <[email protected]>
1 parent 10f66bd commit 5762571

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

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

+10-21
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,41 +1724,30 @@ 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;
17351734
while (timeout >= 0) {
17361735
try {
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-
}
1736+
assertEquals(OK, regularClient.scriptKill().get());
17451737
scriptKilled = true;
17461738
break;
1747-
} catch (RequestException ignored) {
17481739
} 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")) {
1740+
// If exception says "no scripts in execution right now", rerun script.
1741+
if (exception.getCause() instanceof RequestException
1742+
&& executionException
1743+
.getMessage()
1744+
.toLowerCase()
1745+
.contains("no scripts in execution right now")) {
17561746
testClient.invokeScript(script);
17571747
timeout = 4000; // TODO: see if this is a good idea or not
1758-
System.out.println("Printed!!");
1759-
first = false;
17601748
Thread.sleep(1000);
17611749
}
1750+
} catch (RequestException ignored) {
17621751
}
17631752
Thread.sleep(500);
17641753
timeout -= 500;

0 commit comments

Comments
 (0)