Skip to content

Commit

Permalink
Skip flaky test on travis-ci.
Browse files Browse the repository at this point in the history
  • Loading branch information
coleifer committed Jan 8, 2020
1 parent e7f58e0 commit 778790e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ addons:
services:
- redis
install: "pip install gevent redis peewee ukt"
env: HUEY_TRAVIS=1
script: "python runtests.py"
notifications:
email: true
3 changes: 3 additions & 0 deletions huey/tests/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import contextlib
import logging
import os
import unittest

from huey.api import MemoryHuey
Expand All @@ -14,6 +15,8 @@ def emit(self, record): pass
logger = logging.getLogger('huey')
logger.addHandler(NullHandler())

TRAVIS = bool(os.environ.get('HUEY_TRAVIS'))


class BaseTestCase(unittest.TestCase):
consumer_class = Consumer
Expand Down
2 changes: 2 additions & 0 deletions huey/tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from huey.storage import MemoryStorage
from huey.storage import RedisExpireStorage
from huey.tests.base import BaseTestCase
from huey.tests.base import TRAVIS


class StorageTests(object):
Expand Down Expand Up @@ -321,6 +322,7 @@ def test_filesystem_result_store(self):
self.assertTrue(os.path.exists(self.result_path))
self.assertEqual(os.listdir(self.result_path), [])

@unittest.skipIf(TRAVIS, 'skipping test that is flaky on travis-ci')
def test_fs_multithreaded(self):
def create_tasks(t, n, q):
for i in range(n):
Expand Down

0 comments on commit 778790e

Please sign in to comment.