stop hardcode timeout in tempest tests
Change-Id: If51e2d5628a32dde7ab1bd2ea809c015c0db8732
diff --git a/ceilometer/tests/tempest/config.py b/ceilometer/tests/tempest/config.py
index 3749b97..4125a7f 100644
--- a/ceilometer/tests/tempest/config.py
+++ b/ceilometer/tests/tempest/config.py
@@ -39,5 +39,12 @@
cfg.BoolOpt('deprecated_api_enabled',
default=True,
help="Runs Ceilometer deprecated API tests"),
-
+ cfg.IntOpt('notification_wait',
+ default=120,
+ help="The seconds to wait for notifications which "
+ "containers and objects sent to swift."),
+ cfg.IntOpt('notification_sleep',
+ default=1,
+ help="The seconds to sleep after an unsuccessful "
+ "notification received."),
]
diff --git a/ceilometer/tests/tempest/scenario/test_object_storage_telemetry_middleware.py b/ceilometer/tests/tempest/scenario/test_object_storage_telemetry_middleware.py
index cb8ce74..92599a4 100644
--- a/ceilometer/tests/tempest/scenario/test_object_storage_telemetry_middleware.py
+++ b/ceilometer/tests/tempest/scenario/test_object_storage_telemetry_middleware.py
@@ -27,15 +27,6 @@
LOG = logging.getLogger(__name__)
-# Loop for up to 120 seconds waiting on notifications
-# NOTE(chdent): The choice of 120 seconds is fairly
-# arbitrary: Long enough to give the notifications the
-# chance to travel across a highly latent bus but not
-# so long as to allow excessive latency to never be visible.
-# TODO(chdent): Ideally this value would come from configuration.
-NOTIFICATIONS_WAIT = 120
-NOTIFICATIONS_SLEEP = 1
-
class ClientManager(client.Manager):
@@ -114,11 +105,12 @@
return (container_name in containers and obj_name in objects)
- self.assertTrue(test.call_until_true(_check_samples,
- NOTIFICATIONS_WAIT,
- NOTIFICATIONS_SLEEP),
- 'Correct notifications were not received after '
- '%s seconds.' % NOTIFICATIONS_WAIT)
+ self.assertTrue(
+ test.call_until_true(_check_samples,
+ CONF.telemetry.notification_wait,
+ CONF.telemetry.notification_sleep),
+ 'Correct notifications were not received after '
+ '%s seconds.' % CONF.telemetry.notification_wait)
def create_container(self):
name = data_utils.rand_name('swift-scenario-container')