You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/08/11 08:58:43 UTC

[GitHub] [ignite] anton-vinogradov commented on a change in pull request #8137: Ignite ducktape test decorators

anton-vinogradov commented on a change in pull request #8137:
URL: https://github.com/apache/ignite/pull/8137#discussion_r468429540



##########
File path: modules/ducktests/tests/ignitetest/services/utils/control_utility.py
##########
@@ -105,18 +105,22 @@ def deactivate(self):
 
     @staticmethod
     def __parse_cluster_state(output):
-        state_pattern = re.compile("Cluster state: ([^\\s]+)")
-        topology_pattern = re.compile("Current topology version: (\\d+)")
-        baseline_pattern = re.compile("Consistent(Id|ID)=([^\\s]+),\\sS(tate|TATE)=([^\\s]+),?(\\sOrder=(\\d+))?")
+        state_pattern = re.compile("Cluster state: (?P<cluster_state>[^\\s]+)")
+        topology_pattern = re.compile("Current topology version: (?P<topology_version>\\d+)")
+        baseline_pattern = re.compile("Consistent(Id|ID)=(?P<consistent_id>[^\\s]+),\\sS(tate|TATE)=(?P<state>[^\\s]+),"
+                                      "?(\\sOrder=(?P<order>\\d+))?")
 
         match = state_pattern.search(output)
-        state = match.group(1) if match else None
+        state = match.group("cluster_state") if match else None
 
         match = topology_pattern.search(output)
-        topology = int(match.group(1)) if match else None
+        topology = int(match.group("topology_version")) if match else None
 
-        baseline = [BaselineNode(consistent_id=m[1], state=m[3], order=int(m[5]) if m[5] else None)
-                    for m in baseline_pattern.findall(output)]
+        baseline = []
+        for match in baseline_pattern.finditer(output):

Review comment:
       match variable redefinition makes code unreadable for me. 




----------------------------------------------------------------
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