@@ -1700,7 +1700,7 @@ public void scriptFlush(GlideClient regularClient) {
1700
1700
script .close ();
1701
1701
}
1702
1702
1703
- // @Disabled("flaky test: re-enable once fixed")
1703
+ // @Disabled("flaky test: re-enable once fixed")
1704
1704
@ ParameterizedTest
1705
1705
@ MethodSource ("getClients" )
1706
1706
@ SneakyThrows
@@ -1724,41 +1724,30 @@ public void scriptKill(GlideClient regularClient) {
1724
1724
try (var testClient =
1725
1725
GlideClient .createClient (commonClientConfig ().requestTimeout (10000 ).build ()).get ()) {
1726
1726
try {
1727
- // testClient.invokeScript(script);
1727
+ testClient .invokeScript (script );
1728
1728
1729
1729
Thread .sleep (1000 );
1730
1730
1731
1731
// Run script kill until it returns OK
1732
1732
boolean scriptKilled = false ;
1733
1733
int timeout = 4000 ; // ms
1734
- boolean first = true ;
1735
1734
while (timeout >= 0 ) {
1736
1735
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 ());
1745
1737
scriptKilled = true ;
1746
1738
break ;
1747
- } catch (RequestException ignored ) {
1748
1739
} 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" )) {
1756
1746
testClient .invokeScript (script );
1757
1747
timeout = 4000 ; // TODO: see if this is a good idea or not
1758
- System .out .println ("Printed!!" );
1759
- first = false ;
1760
1748
Thread .sleep (1000 );
1761
1749
}
1750
+ } catch (RequestException ignored ) {
1762
1751
}
1763
1752
Thread .sleep (500 );
1764
1753
timeout -= 500 ;
0 commit comments