From 6c39de6afe5178d51db7a5315e1c8d3a9598f78f Mon Sep 17 00:00:00 2001 From: Philipp Schlipper Date: Tue, 26 Apr 2022 17:47:25 +0200 Subject: [PATCH 1/3] Experimental changes --- src/systests/test_logging.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/systests/test_logging.py b/src/systests/test_logging.py index b12f2c5..fc62270 100644 --- a/src/systests/test_logging.py +++ b/src/systests/test_logging.py @@ -34,7 +34,7 @@ from vmcontrol.vmmcontroller import VBoxController MAX_RUNTIME = 10 * 60 # Ten minutes -pytestmark = [pytest.mark.systest, pytest.mark.unstable] +pytestmark = [pytest.mark.systest, pytest.mark.logging] @pytest.fixture(scope="module") @@ -113,9 +113,9 @@ def check_local_log_format(self, machine, token, timeout_counter): def check_remote_log_format(self, es_query, timeout_counter): try_until_counter_reached( - lambda: self.query_elasticsearch(es_query, timeout_counter), + lambda: self.query_elasticsearch(es_query), timeout_counter, - exception=IndexError, + exception=(IndexError, OSError, KeyError), assertion_func=lambda x: self.check_elasticsearch_response(x, es_query)) def exec_command_and_get_output_list(self, machine, command, timeout_counter): @@ -150,17 +150,14 @@ def test_is_iso8601_timestamp(self): self.is_iso8601_timestamp(invalid_timestamp) for invalid_timestamp in invalid_timestamps) - def query_elasticsearch(self, es_query, timeout_counter): + def query_elasticsearch(self, es_query): headers = {"Content-type": "application/json", "Accept": "text/plain"} conn = HTTPConnection(f"{self.log_server.hostname}:9200") search_query = json.dumps( {"query": {"constant_score": {"filter": {"term": { es_query.search_keyword: es_query.token}}}}}) - try_until_counter_reached( - lambda: conn.request( - method="POST", url="/_search", body=str(search_query), headers=headers), - timeout_counter, - exception=(TimeoutError, ConnectionRefusedError, CannotSendRequest)) + conn.request( + method="POST", url="/_search", body=str(search_query), headers=headers) return str(conn.getresponse().read(), 'utf-8') def check_elasticsearch_response(self, response, es_query): From a1d42bb9d2f49d96ca371133bdc6c7de024ccdd3 Mon Sep 17 00:00:00 2001 From: Philipp Schlipper Date: Wed, 18 May 2022 09:28:49 +0200 Subject: [PATCH 2/3] Increase systest timeout to prevent cancelling an otherwise successful systest --- .github/workflows/socbed-systemtest-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/socbed-systemtest-dev.yml b/.github/workflows/socbed-systemtest-dev.yml index 2b288e2..7d236fd 100644 --- a/.github/workflows/socbed-systemtest-dev.yml +++ b/.github/workflows/socbed-systemtest-dev.yml @@ -109,7 +109,7 @@ jobs: - name: Run stable system tests uses: nick-invision/retry@v2 with: - timeout_minutes: 30 + timeout_minutes: 45 max_attempts: 5 on_retry_command: ./tools/cleanup_failed_session command: tox -- -m "systest and not unstable" From 7aece81747c29370f72bb42cf9858e49e0d99605 Mon Sep 17 00:00:00 2001 From: Philipp Schlipper Date: Wed, 18 May 2022 09:30:14 +0200 Subject: [PATCH 3/3] Increase timeout value for certain provisioner that needlessly fails due to that timeout --- provisioning/packer/attacker.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provisioning/packer/attacker.json b/provisioning/packer/attacker.json index b8159c5..4793b27 100644 --- a/provisioning/packer/attacker.json +++ b/provisioning/packer/attacker.json @@ -96,7 +96,7 @@ { "expect_disconnect": "true", "script": "./post_install/attacker_setup.sh", - "timeout": "2m", + "timeout": "5m", "type": "shell" }, { @@ -104,7 +104,7 @@ "-i", "../ansible/hosts" ], - "pause_before": "2m", + "pause_before": "5m", "playbook_file": "../ansible/attacker_playbook.yml", "type": "ansible" }