commit 2ec42fe: [Test] Sigh, just wait...

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jul 19 17:42:05 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-19 18:36:47 +0100
URL: https://github.com/rspamd/rspamd/commit/2ec42fe11c7d9b1f5d1447803bd9453a768866ef (HEAD -> master)

[Test] Sigh, just wait...

---
 lualib/lua_redis.lua                   | 9 ++++++++-
 test/functional/cases/330_neural.robot | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua
index f62ee05bb..67bf271ab 100644
--- a/lualib/lua_redis.lua
+++ b/lualib/lua_redis.lua
@@ -1299,7 +1299,14 @@ local function exec_redis_script(id, params, callback, keys, args)
       table.insert(script.waitq, do_call)
     else
       -- TODO: fix taskfull requests
-      callback('NOSCRIPT', nil)
+      table.insert(script.waitq, function()
+        if script.loaded then
+          do_call(false)
+        else
+          callback('NOSCRIPT', nil)
+        end
+      end)
+      load_script_task(script, params.task)
     end
   end
 
diff --git a/test/functional/cases/330_neural.robot b/test/functional/cases/330_neural.robot
index e08a36145..5751ee60f 100644
--- a/test/functional/cases/330_neural.robot
+++ b/test/functional/cases/330_neural.robot
@@ -15,6 +15,7 @@ ${RSPAMD_SCOPE}  Suite
 
 *** Test Cases ***
 Train Spam
+  Sleep  2s  Wait for redis mess
   : FOR    ${INDEX}    IN RANGE    0    10
   \  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={symbols_enabled = ["SPAM_SYMBOL"]}
   \  Check Rspamc  ${result}  SPAM_SYMBOL (1.00)


More information about the Commits mailing list