From 3868d64577c2d5bf14e814b235db8da5555f106b Mon Sep 17 00:00:00 2001 From: ravillar <raul.villar.ramos@cern.ch> Date: Tue, 8 Feb 2022 10:51:36 +0100 Subject: [PATCH 1/3] trimmer update --- rallytester/conf/regex.py | 6 ++++++ rallytester/tests/test_trimmer.py | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/rallytester/conf/regex.py b/rallytester/conf/regex.py index 0ea76ca..80d8f2b 100644 --- a/rallytester/conf/regex.py +++ b/rallytester/conf/regex.py @@ -14,7 +14,9 @@ enabled_regex = cfg.ListOpt( 'id_rally_replace', 'req_replace', 'long_id_replace', + 'project', 'resource_replace', + 'shared', 'quota_exceeded', 'rally_tired', 'remote_error', @@ -66,8 +68,10 @@ regex_dict = cfg.DictOpt( "id_rally_replace": "rally\\-([\\w\\-]{8,})", "req_replace": "req-[\\w\\-\\:]{12,}", "long_id_replace": "([a-f0-9]{32}|[a-f0-9\\-]{36})", + "project": "(PROJECT)(.*)(Migration failed)(.*)(change host)(.*)", "resource_replace": "Resource [a-z0-9\\-]{15,}", "resource_limit": "(.*)(Resource limit exceeded: .* per project)(.*)", + "shared": "(SHARED)(.*)(ERROR status)(.*)(message)(.*)('})", "quota_exceeded": "Requested [0-9]*, [0-9]*, but already used [0-9]*," " [0-9]* of [0-9]*, [0-9]*", "rally_tired": "(Rally tired waiting)\\s([0-9]*\\.00 seconds for|for)" @@ -93,8 +97,10 @@ substitution_dict = cfg.DictOpt( "id_rally_replace": "rally-xyz", "req_replace": "req-xyz", "long_id_replace": "xyz", + "project": "PROJECT: Migration error instance did not change host", "resource_replace": "Resource xyz", "resource_limit": "\\2", + "shared": "Shared server xyz error status build failed. code 500", "quota_exceeded": "Requested .....", "rally_tired": "waiting for \\3 to become \\4", "remote_error": "\\1 \\2", diff --git a/rallytester/tests/test_trimmer.py b/rallytester/tests/test_trimmer.py index 66e5e65..40bea0b 100644 --- a/rallytester/tests/test_trimmer.py +++ b/rallytester/tests/test_trimmer.py @@ -96,6 +96,19 @@ class TestMsgTrimmer(unittest.TestCase): "req-xyz)", "Resource limit exceeded: You have reached the maximum clusters " "per project" + ), ( + "shared", + "SHARED: Resource <Server: rally-xyz> has ERROR status. Fault: " + "{'message': 'Build of instance xyz aborted: Failed to allocate " + "the network(s) with error No fixed IP addresses available for " + "network: xyz, not rescheduling.', 'code': 500, 'created': " + "'date'}", + "Shared server xyz error status build failed. code 500" + ), ( + "project", + "PROJECT: Live Migration failed: Migration complete but " + "instance did not change host: i66366241007557.cern.ch", + "PROJECT: Migration error instance did not change host" ) ]) def test_regex(self, testname, message, result): -- GitLab From ed9196d14a1fae092599d4af5de1b56633e00708 Mon Sep 17 00:00:00 2001 From: ravillar <raul.villar.ramos@cern.ch> Date: Mon, 14 Feb 2022 16:15:42 +0100 Subject: [PATCH 2/3] Simple error message --- rallytester/conf/regex.py | 4 ++-- rallytester/tests/test_trimmer.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rallytester/conf/regex.py b/rallytester/conf/regex.py index 80d8f2b..14ac229 100644 --- a/rallytester/conf/regex.py +++ b/rallytester/conf/regex.py @@ -97,10 +97,10 @@ substitution_dict = cfg.DictOpt( "id_rally_replace": "rally-xyz", "req_replace": "req-xyz", "long_id_replace": "xyz", - "project": "PROJECT: Migration error instance did not change host", + "project": "Project migration failed", "resource_replace": "Resource xyz", "resource_limit": "\\2", - "shared": "Shared server xyz error status build failed. code 500", + "shared": "Shared migration failed", "quota_exceeded": "Requested .....", "rally_tired": "waiting for \\3 to become \\4", "remote_error": "\\1 \\2", diff --git a/rallytester/tests/test_trimmer.py b/rallytester/tests/test_trimmer.py index 40bea0b..03694a3 100644 --- a/rallytester/tests/test_trimmer.py +++ b/rallytester/tests/test_trimmer.py @@ -103,12 +103,12 @@ class TestMsgTrimmer(unittest.TestCase): "the network(s) with error No fixed IP addresses available for " "network: xyz, not rescheduling.', 'code': 500, 'created': " "'date'}", - "Shared server xyz error status build failed. code 500" + "Shared migration failed" ), ( "project", "PROJECT: Live Migration failed: Migration complete but " "instance did not change host: i66366241007557.cern.ch", - "PROJECT: Migration error instance did not change host" + "Project migration failed" ) ]) def test_regex(self, testname, message, result): -- GitLab From 4ff6c13b477427d990959e5672e93ba718a4c406 Mon Sep 17 00:00:00 2001 From: ravillar <raul.villar.ramos@cern.ch> Date: Mon, 14 Feb 2022 16:36:25 +0100 Subject: [PATCH 3/3] Simplify trimmer --- rallytester/conf/regex.py | 9 +++------ rallytester/tests/test_trimmer.py | 14 +++----------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/rallytester/conf/regex.py b/rallytester/conf/regex.py index 14ac229..133a835 100644 --- a/rallytester/conf/regex.py +++ b/rallytester/conf/regex.py @@ -14,9 +14,8 @@ enabled_regex = cfg.ListOpt( 'id_rally_replace', 'req_replace', 'long_id_replace', - 'project', + 'migration', 'resource_replace', - 'shared', 'quota_exceeded', 'rally_tired', 'remote_error', @@ -68,10 +67,9 @@ regex_dict = cfg.DictOpt( "id_rally_replace": "rally\\-([\\w\\-]{8,})", "req_replace": "req-[\\w\\-\\:]{12,}", "long_id_replace": "([a-f0-9]{32}|[a-f0-9\\-]{36})", - "project": "(PROJECT)(.*)(Migration failed)(.*)(change host)(.*)", + "migration": "(.*)(Migration failed)(.*)(change host)(.*)", "resource_replace": "Resource [a-z0-9\\-]{15,}", "resource_limit": "(.*)(Resource limit exceeded: .* per project)(.*)", - "shared": "(SHARED)(.*)(ERROR status)(.*)(message)(.*)('})", "quota_exceeded": "Requested [0-9]*, [0-9]*, but already used [0-9]*," " [0-9]* of [0-9]*, [0-9]*", "rally_tired": "(Rally tired waiting)\\s([0-9]*\\.00 seconds for|for)" @@ -97,10 +95,9 @@ substitution_dict = cfg.DictOpt( "id_rally_replace": "rally-xyz", "req_replace": "req-xyz", "long_id_replace": "xyz", - "project": "Project migration failed", + "migration": "migration failed", "resource_replace": "Resource xyz", "resource_limit": "\\2", - "shared": "Shared migration failed", "quota_exceeded": "Requested .....", "rally_tired": "waiting for \\3 to become \\4", "remote_error": "\\1 \\2", diff --git a/rallytester/tests/test_trimmer.py b/rallytester/tests/test_trimmer.py index 03694a3..b8c4cd5 100644 --- a/rallytester/tests/test_trimmer.py +++ b/rallytester/tests/test_trimmer.py @@ -97,18 +97,10 @@ class TestMsgTrimmer(unittest.TestCase): "Resource limit exceeded: You have reached the maximum clusters " "per project" ), ( - "shared", - "SHARED: Resource <Server: rally-xyz> has ERROR status. Fault: " - "{'message': 'Build of instance xyz aborted: Failed to allocate " - "the network(s) with error No fixed IP addresses available for " - "network: xyz, not rescheduling.', 'code': 500, 'created': " - "'date'}", - "Shared migration failed" - ), ( - "project", - "PROJECT: Live Migration failed: Migration complete but " + "migration", + "Live Migration failed: Migration complete but " "instance did not change host: i66366241007557.cern.ch", - "Project migration failed" + "migration failed" ) ]) def test_regex(self, testname, message, result): -- GitLab