From 60398e69d7efdc735d40a42931611fc777aa2809 Mon Sep 17 00:00:00 2001
From: Simon Belak <simon.belak@gmail.com>
Date: Wed, 6 Dec 2017 15:05:37 +0100
Subject: [PATCH] Wait for result to become available

---
 test/metabase/test/async.clj | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/metabase/test/async.clj b/test/metabase/test/async.clj
index e0b291b3709..81ee5533aff 100644
--- a/test/metabase/test/async.clj
+++ b/test/metabase/test/async.clj
@@ -32,5 +32,10 @@
 (defn result!
   "Blocking version of async/result."
   [job-id]
-  (while-with-timeout (not (@job-done? job-id)))
+  (while-with-timeout (or (not (@job-done? job-id))
+                          (-> job-id
+                              ComputationJob
+                              async/result
+                              (find :result)
+                              nil?)))
   (async/result (ComputationJob job-id)))
-- 
GitLab