[MERGED] osmo-gsm-tester[master]: on timeout, raise dedicated Timeout exception

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon May 8 11:07:55 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: on timeout, raise dedicated Timeout exception
......................................................................


on timeout, raise dedicated Timeout exception

Change-Id: I085a52194dde0f5e6dd845ffde1197f7dc83b306
---
M src/osmo_gsm_tester/suite.py
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 94c3882..2313ae2 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -24,6 +24,9 @@
 from . import config, log, template, util, resource, schema, ofono_client, osmo_nitb
 from . import test
 
+class Timeout(Exception):
+    pass
+
 class SuiteDefinition(log.Origin):
     '''A test suite reserves resources for a number of tests.
        Each test requires a specific number of modems, BTSs etc., which are
@@ -262,7 +265,7 @@
 
     def wait(self, condition, *condition_args, timeout=300, timestep=1, **condition_kwargs):
         if not self._wait(condition, condition_args, condition_kwargs, timeout, timestep):
-            raise RuntimeError('Timeout expired')
+            raise Timeout('Timeout expired')
 
     def sleep(self, seconds):
         assert seconds > 0.

-- 
To view, visit https://gerrit.osmocom.org/2513
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I085a52194dde0f5e6dd845ffde1197f7dc83b306
Gerrit-PatchSet: 4
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list