You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/05/11 20:36:18 UTC

[GitHub] [qpid-dispatch] ganeshmurthy commented on a change in pull request #1212: DISPATCH-1930: Make sure log file is created before searching the log…

ganeshmurthy commented on a change in pull request #1212:
URL: https://github.com/apache/qpid-dispatch/pull/1212#discussion_r630522947



##########
File path: tests/system_tests_bad_configuration.py
##########
@@ -109,15 +109,23 @@ def wait_for_unresolvable_host(self):
         then it stops scheduling new attempts.
         :return:
         """
-        with open(self.router.logfile_path, 'r') as router_log:
-            log_lines = router_log.read().split("\n")
-            expected_log_snip = "Connection to %s" % self.unresolvable_host_name
-            errors_caught = [line for line in log_lines if expected_log_snip in line and "failed" in line]
-
-            self.error_caught = any(errors_caught)
-
-            # If condition not yet satisfied and not exhausted max attempts,
-            # re-schedule the verification.
+        try:
+            with open(self.router.logfile_path, 'r') as router_log:
+                log_lines = router_log.read().split("\n")
+                expected_log_snip = "Connection to %s" % self.unresolvable_host_name
+                errors_caught = [line for line in log_lines if expected_log_snip in line and "failed" in line]
+
+                self.error_caught = any(errors_caught)
+
+                # If condition not yet satisfied and not exhausted max attempts,
+                # re-schedule the verification.
+                if self.waiting_for_error():
+                    self.attempts_made += 1
+                    self.schedule_timer()
+        except:

Review comment:
       Will use IOError, thx




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org