Reduce duration of some long-running tests
This patch reduces the duration of some tests related to Redis and Mongo so that developers can get faster turnaround on feedback when testing locally or waiting on the py27 gate. Change-Id: Ie50a0f5c41ff1a5fd0154dd895220df9c6e64fee
This commit is contained in:
parent
b386d6d078
commit
21f31ac35a
@ -15,3 +15,7 @@ uri = mongodb://127.0.0.1:27017
|
||||
database = zaqar_test
|
||||
max_reconnect_attempts = 3
|
||||
reconnect_sleep = 0.001
|
||||
|
||||
# NOTE(kgriffs): Reduce from the default of 1000 to reduce the
|
||||
# duration of related tests
|
||||
max_attempts = 5
|
||||
|
@ -11,5 +11,11 @@ port = 8888
|
||||
|
||||
[drivers:storage:redis]
|
||||
uri = redis://127.0.0.1:6379
|
||||
|
||||
# NOTE(kgriffs): Reduce from the default of 10 to reduce the
|
||||
# duration of related tests
|
||||
max_reconnect_attempts = 3
|
||||
reconnect_sleep = 1
|
||||
|
||||
# NOTE(kgriffs): Reduce from the default of 1 to reduce the
|
||||
# duration of related tests
|
||||
reconnect_sleep = 0.1
|
@ -47,10 +47,12 @@ class TestUtils(testing.TestBase):
|
||||
@testing.requires_mongodb
|
||||
def test_can_connect_fails_if_bad_uri_mongodb(self):
|
||||
self.config(unreliable=True)
|
||||
self.assertFalse(utils.can_connect('mongodb://localhost:8080',
|
||||
conf=self.conf))
|
||||
self.assertFalse(utils.can_connect('mongodb://example.com:27017',
|
||||
conf=self.conf))
|
||||
|
||||
uri = 'mongodb://localhost:8080?connectTimeoutMS=100'
|
||||
self.assertFalse(utils.can_connect(uri, conf=self.conf))
|
||||
|
||||
uri = 'mongodb://example.com:27017?connectTimeoutMS=100'
|
||||
self.assertFalse(utils.can_connect(uri, conf=self.conf))
|
||||
|
||||
@testing.requires_redis
|
||||
def test_can_connect_fails_if_bad_uri_redis(self):
|
||||
|
@ -382,12 +382,11 @@ class MongodbMessageTests(MongodbSetupMixin, base.MessageControllerTest):
|
||||
self.assertEqual(len(created), 1)
|
||||
|
||||
# Force infinite retries
|
||||
if testing.RUN_SLOW_TESTS:
|
||||
method.return_value = None
|
||||
method.return_value = None
|
||||
|
||||
with testing.expect(errors.MessageConflict):
|
||||
self.controller.post(queue_name, messages,
|
||||
uuid, project=self.project)
|
||||
with testing.expect(errors.MessageConflict):
|
||||
self.controller.post(queue_name, messages,
|
||||
uuid, project=self.project)
|
||||
|
||||
created = list(self.controller.post(queue_name,
|
||||
expected_messages[1:],
|
||||
|
@ -288,12 +288,12 @@ class RedisClaimsTest(base.ClaimControllerTest):
|
||||
self.controller.get, queue_name,
|
||||
epoch, project=None)
|
||||
|
||||
claim_id, messages = self.controller.create(queue_name, {'ttl': 2,
|
||||
claim_id, messages = self.controller.create(queue_name, {'ttl': 1,
|
||||
'grace': 0},
|
||||
project=None)
|
||||
|
||||
# Lets let it expire
|
||||
time.sleep(2)
|
||||
time.sleep(1)
|
||||
self.assertRaises(storage.errors.ClaimDoesNotExist,
|
||||
self.controller.update, queue_name,
|
||||
claim_id, {}, project=None)
|
||||
|
Loading…
Reference in New Issue
Block a user