Skip to content
Snippets Groups Projects
Commit 979e431e authored by Cam Saul's avatar Cam Saul
Browse files

fix occasional test failures, again :sob:

parent e7e31447
No related branches found
No related tags found
No related merge requests found
......@@ -67,16 +67,16 @@
:restarted]
[(do
(stop-task-runner!)
(with-redefs [metabase.task/hourly-task-delay (constantly 50)
(with-redefs [metabase.task/hourly-task-delay (constantly 100)
metabase.task/hourly-tasks-hook mock-hourly-tasks-hook]
(add-hook! #'hourly-tasks-hook inc-task-test-atom-counter-by-system-hour)
(reset! task-test-atom-counter 0)
(start-task-runner!)
[@task-test-atom-counter ; should be 0, since not enough time has elaspsed for the hook to be executed
(do (Thread/sleep 75)
@task-test-atom-counter) ; should have been called once (~25ms ago)
(do (Thread/sleep 100)
(do (Thread/sleep 150)
@task-test-atom-counter) ; should have been called once (~50ms ago)
(do (Thread/sleep 200)
@task-test-atom-counter) ; should have been called two more times
(do (stop-task-runner!)
:stopped)]))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment