Review at

event_loop: Avoid leaking active timeouts on poll exception

It was spotted that when an error ocurred during poll generating an
exception to finish the test (osmo-msc ended prematurely), then the
active wait() condition was kept being checked for later tests, making
all followup tests fail.

That's because in case of exception we were not making sure the timeout
is removed and it kept firing forever.

Change-Id: I5c93cd67b2b83c0ecee96fbc6c4200b419bdf73f
M src/osmo_gsm_tester/
1 file changed, 5 insertions(+), 1 deletion(-)

  git pull ssh:// refs/changes/62/7662/1

diff --git a/src/osmo_gsm_tester/ 
index a9683dd..64a110d 100644
--- a/src/osmo_gsm_tester/
+++ b/src/osmo_gsm_tester/
@@ -96,7 +96,11 @@
         wait_req = WaitRequest(condition, condition_args, condition_kwargs, 
timeout, timestep)
         wait_id = GObject.timeout_add(timestep*1000, self._trigger_cb_func, 
         while True:
-            self.poll(may_block=True)
+            try:
+                self.poll(may_block=True)
+            except Exception: # cleanup of temporary resources in the wait 
+                GObject.source_remove(wait_id)
+                raise
             if wait_req.condition_ack or wait_req.timeout_ack:
                 success = wait_req.condition_ack

To view, visit
To unsubscribe, visit

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c93cd67b2b83c0ecee96fbc6c4200b419bdf73f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <>

Reply via email to