From 8456e868a208d3b832ace5d97bff4765f4e7bb54 Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Wed, 21 Jun 2023 19:35:19 +0000 Subject: [PATCH 1/6] DAOS-12946 test: fix telemetry_pool_metrics with ior error Fix management of ior errors: canceling the test as we do not know how much data have been transferred. Test-tag: pr test_telemetry_pool_metrics Required-githooks: true Signed-off-by: Cedric Koch-Hofer --- src/tests/ftest/telemetry/telemetry_pool_metrics.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tests/ftest/telemetry/telemetry_pool_metrics.py b/src/tests/ftest/telemetry/telemetry_pool_metrics.py index 86cc1f21400..e7b22802c0a 100644 --- a/src/tests/ftest/telemetry/telemetry_pool_metrics.py +++ b/src/tests/ftest/telemetry/telemetry_pool_metrics.py @@ -158,8 +158,13 @@ def test_telemetry_pool_metrics(self): self.ior_cmd.dfs_chunk.update(self.ior_cmd.transfer_size.value) self.run_ior_with_pool( timeout=200, create_pool=False, create_cont=False) - except TestFail: - self.log.info("#ior command failed!") + except TestFail as error: + # NOTE DAOS-12946: it is not possible to properly test the metrics as we do not know + # how much data have been transferred. Thus we cancel the test, as the purpose of this + # test is not to check the ior command. + self.log.error(">>>>>> IOR command failed: %s", str(error)) + self.log.info("------ Test canceled ------") + self.cancel("IOR command failed: {}".format(error)) # collect second set of pool metric data after read/write metrics_end = self.get_metrics(metric_names) From e397fbbf9f125e8ba7c04d80c8902b684416a1ba Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Wed, 21 Jun 2023 19:35:19 +0000 Subject: [PATCH 2/6] DAOS-12946 test: fix telemetry_pool_metrics with ior error Integrate Reviewers comments. Test-tag: TelemetryPoolMetrics,test_telemetry_pool_metrics Required-githooks: true Signed-off-by: Cedric Koch-Hofer --- src/tests/ftest/telemetry/telemetry_pool_metrics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/ftest/telemetry/telemetry_pool_metrics.py b/src/tests/ftest/telemetry/telemetry_pool_metrics.py index e7b22802c0a..b8c121466af 100644 --- a/src/tests/ftest/telemetry/telemetry_pool_metrics.py +++ b/src/tests/ftest/telemetry/telemetry_pool_metrics.py @@ -160,10 +160,10 @@ def test_telemetry_pool_metrics(self): timeout=200, create_pool=False, create_cont=False) except TestFail as error: # NOTE DAOS-12946: it is not possible to properly test the metrics as we do not know - # how much data have been transferred. Thus we cancel the test, as the purpose of this - # test is not to check the ior command. - self.log.error(">>>>>> IOR command failed: %s", str(error)) - self.log.info("------ Test canceled ------") + # how much data have been transferred. However, the reason of the ior failure should be + # investigated and thus we fail the test. + self.log.error(">>>>>> Failure of IOR is unexpected and should be investigated: %s", + str(error)) self.cancel("IOR command failed: {}".format(error)) # collect second set of pool metric data after read/write From 9ba1c40f1177f943e9d748fd7f15af48ae3f0d59 Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Wed, 21 Jun 2023 19:35:19 +0000 Subject: [PATCH 3/6] DAOS-12946 test: fix telemetry_pool_metrics with ior error Fix flake8 code formating. Test-tag: TelemetryPoolMetrics,test_telemetry_pool_metrics Required-githooks: true Signed-off-by: Cedric Koch-Hofer --- src/tests/ftest/telemetry/telemetry_pool_metrics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/ftest/telemetry/telemetry_pool_metrics.py b/src/tests/ftest/telemetry/telemetry_pool_metrics.py index b8c121466af..941889f886e 100644 --- a/src/tests/ftest/telemetry/telemetry_pool_metrics.py +++ b/src/tests/ftest/telemetry/telemetry_pool_metrics.py @@ -162,7 +162,8 @@ def test_telemetry_pool_metrics(self): # NOTE DAOS-12946: it is not possible to properly test the metrics as we do not know # how much data have been transferred. However, the reason of the ior failure should be # investigated and thus we fail the test. - self.log.error(">>>>>> Failure of IOR is unexpected and should be investigated: %s", + self.log.error( + ">>>>>> Failure of IOR is unexpected and should be investigated: %s", str(error)) self.cancel("IOR command failed: {}".format(error)) From 71525b5b518a149e9dc7c730ddde04df29d1befd Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Wed, 21 Jun 2023 19:35:19 +0000 Subject: [PATCH 4/6] DAOS-12946 test: fix telemetry_pool_metrics with ior error Typo hotfix. Test-tag: TelemetryPoolMetrics,test_telemetry_pool_metrics Required-githooks: true Signed-off-by: Cedric Koch-Hofer --- src/tests/ftest/telemetry/telemetry_pool_metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/ftest/telemetry/telemetry_pool_metrics.py b/src/tests/ftest/telemetry/telemetry_pool_metrics.py index 941889f886e..caad264bce0 100644 --- a/src/tests/ftest/telemetry/telemetry_pool_metrics.py +++ b/src/tests/ftest/telemetry/telemetry_pool_metrics.py @@ -165,7 +165,7 @@ def test_telemetry_pool_metrics(self): self.log.error( ">>>>>> Failure of IOR is unexpected and should be investigated: %s", str(error)) - self.cancel("IOR command failed: {}".format(error)) + self.fail("IOR command failed: {}".format(error)) # collect second set of pool metric data after read/write metrics_end = self.get_metrics(metric_names) From 8ee974189610f9659f43556fb67aa2a3a5fde57d Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Wed, 21 Jun 2023 19:35:19 +0000 Subject: [PATCH 5/6] DAOS-12946 test: fix telemetry_pool_metrics with ior error Integrate reviewers comments. Test-tag: TelemetryPoolMetrics,test_telemetry_pool_metrics Required-githooks: true Signed-off-by: Cedric Koch-Hofer --- .../ftest/telemetry/telemetry_pool_metrics.py | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/tests/ftest/telemetry/telemetry_pool_metrics.py b/src/tests/ftest/telemetry/telemetry_pool_metrics.py index caad264bce0..e7b5c4f216c 100644 --- a/src/tests/ftest/telemetry/telemetry_pool_metrics.py +++ b/src/tests/ftest/telemetry/telemetry_pool_metrics.py @@ -152,20 +152,12 @@ def test_telemetry_pool_metrics(self): metrics_init = self.get_metrics(metric_names) # Run ior command. - try: - self.update_ior_cmd_with_pool(False) - self.ior_cmd.dfs_oclass.update(self.dfs_oclass) - self.ior_cmd.dfs_chunk.update(self.ior_cmd.transfer_size.value) - self.run_ior_with_pool( - timeout=200, create_pool=False, create_cont=False) - except TestFail as error: - # NOTE DAOS-12946: it is not possible to properly test the metrics as we do not know - # how much data have been transferred. However, the reason of the ior failure should be - # investigated and thus we fail the test. - self.log.error( - ">>>>>> Failure of IOR is unexpected and should be investigated: %s", - str(error)) - self.fail("IOR command failed: {}".format(error)) + self.update_ior_cmd_with_pool(False) + self.ior_cmd.dfs_oclass.update(self.dfs_oclass) + self.ior_cmd.dfs_chunk.update(self.ior_cmd.transfer_size.value) + # NOTE DAOS-12946: Not catching ior failures is intended. Indeed, to properly test the + # metrics we have to exactly know how much data have been transferred. + self.run_ior_with_pool(timeout=200, create_pool=False, create_cont=False) # collect second set of pool metric data after read/write metrics_end = self.get_metrics(metric_names) From 8a47ce7941c14080afb35f6a60a5d1c475bd9705 Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Wed, 21 Jun 2023 19:35:19 +0000 Subject: [PATCH 6/6] DAOS-12946 test: fix telemetry_pool_metrics with ior error Integrate reviewers comments: * Remove useless package import https://github.com/daos-stack/daos/pull/12478#issuecomment-1612564183 Test-tag: TelemetryPoolMetrics,test_telemetry_pool_metrics Required-githooks: true Signed-off-by: Cedric Koch-Hofer --- src/tests/ftest/telemetry/telemetry_pool_metrics.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tests/ftest/telemetry/telemetry_pool_metrics.py b/src/tests/ftest/telemetry/telemetry_pool_metrics.py index e7b5c4f216c..edd7c437bf3 100644 --- a/src/tests/ftest/telemetry/telemetry_pool_metrics.py +++ b/src/tests/ftest/telemetry/telemetry_pool_metrics.py @@ -3,7 +3,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent """ -from avocado.core.exceptions import TestFail from ior_test_base import IorTestBase from telemetry_test_base import TestWithTelemetry