mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-04 02:38:11 +08:00
adds short delay in test
On some platforms the cluster is not always ready in time for test assertion
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import sys
|
import sys
|
||||||
from multiprocessing import Queue, Event, Value
|
from multiprocessing import Queue, Event, Value
|
||||||
import threading
|
import threading
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
@@ -52,6 +53,7 @@ def test_cluster_initial(r):
|
|||||||
assert c.is_running
|
assert c.is_running
|
||||||
assert c.is_stopping is False
|
assert c.is_stopping is False
|
||||||
assert c.is_starting is False
|
assert c.is_starting is False
|
||||||
|
sleep(0.5)
|
||||||
stat = c.stat
|
stat = c.stat
|
||||||
assert stat.status == Conf.IDLE
|
assert stat.status == Conf.IDLE
|
||||||
assert c.stop() is True
|
assert c.stop() is True
|
||||||
|
|||||||
Reference in New Issue
Block a user