mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-24 14:58:12 +08:00
Adds Tynd envs for Travis
and fixes timeout tests
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
from time import sleep
|
||||
|
||||
|
||||
def countdown(n):
|
||||
while n > 0:
|
||||
n -= 1
|
||||
@@ -22,6 +25,11 @@ def word_multiply(x, word=''):
|
||||
return len(word) * x
|
||||
|
||||
|
||||
def count_forever():
|
||||
while True:
|
||||
sleep(0.5)
|
||||
|
||||
|
||||
def get_task_name(task):
|
||||
return task.name
|
||||
|
||||
|
||||
@@ -37,7 +37,11 @@ def test_redis():
|
||||
|
||||
|
||||
def test_disque():
|
||||
Conf.DISQUE_NODES = ['127.0.0.1:7711']
|
||||
# Either local disque or Heroku Tynd
|
||||
Conf.DISQUE_NODES = os.getenv('TYND_DISQUE_NODES', ['127.0.0.1:7711'])
|
||||
if os.getenv('TYND_DISQUE_AUTH', False):
|
||||
Conf.DISQUE_AUTH = os.environ['TYND_DISQUE_AUTH']
|
||||
# check broker
|
||||
broker = get_broker(list_key='disque_test')
|
||||
assert broker.ping() is True
|
||||
assert broker.info() is not None
|
||||
|
||||
Reference in New Issue
Block a user