@@ -2422,27 +2422,12 @@ func (suite *GlideTestSuite) TestScriptKillWithoutRoute() {
24222422 require .NoError (suite .T (), err )
24232423 killClient := suite .defaultClusterClient ()
24242424
2425- // Ensure no script is running at the beginning
2426- _ , err = killClient .ScriptKill (context .Background ())
2427- assert .Error (suite .T (), err )
2428- assert .True (suite .T (), strings .Contains (strings .ToLower (err .Error ()), "notbusy" ))
2429-
2430- // Kill Running Code
2431- code := CreateLongRunningLuaScript (5 , true )
2432- script := options .NewScript (code )
2433-
2434- go invokeClient .InvokeScript (context .Background (), * script )
2435-
2436- time .Sleep (1 * time .Second )
2437-
2438- result , err := killClient .ScriptKill (context .Background ())
2425+ // Flush before setup
2426+ result , err := invokeClient .ScriptFlush (context .Background ())
24392427 assert .NoError (suite .T (), err )
24402428 assert .Equal (suite .T (), "OK" , result )
2441- script .Close ()
2442-
2443- time .Sleep (1 * time .Second )
24442429
2445- // Ensure no script is running at the end
2430+ // Nothing loaded, nothing to kill
24462431 _ , err = killClient .ScriptKill (context .Background ())
24472432 assert .Error (suite .T (), err )
24482433 assert .True (suite .T (), strings .Contains (strings .ToLower (err .Error ()), "notbusy" ))
@@ -2503,15 +2488,15 @@ func (suite *GlideTestSuite) TestScriptKillUnkillableWithoutRoute() {
25032488
25042489 go invokeClient .InvokeScriptWithOptions (context .Background (), * script , * options .NewScriptOptions ().WithKeys ([]string {key }))
25052490
2506- time .Sleep (1 * time .Second )
2491+ time .Sleep (3 * time .Second )
25072492
25082493 _ , err = killClient .ScriptKill (context .Background ())
25092494 assert .Error (suite .T (), err )
25102495 assert .True (suite .T (), strings .Contains (strings .ToLower (err .Error ()), "unkillable" ))
25112496 script .Close ()
25122497
25132498 // Wait until script finishes
2514- time .Sleep (6 * time .Second )
2499+ time .Sleep (4 * time .Second )
25152500
25162501 // Ensure no script is running at the end
25172502 _ , err = killClient .ScriptKill (context .Background ())
0 commit comments