Skip to contentSkip to conversation

service: split tests to perf and autotest to avoid spurious CI failures

PATCH Superseded Harry van Haaren 2 participants 7 messages Feb 24, 2023 – Mar 7, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 service: split tests to perf and autotest to avoid spurious CI failures

On some CI runs, some service-cores tests spuriously fail as the service lcore thread is not actually scheduled by the OS in the given amount of time.

Increasing timeouts has not resolved the issue in the CI, so the solution in this patch is to move them to a separate perf test suite.

---

See DPDK ML discussion in this thread:
http://mails.dpdk.org/archives/dev/2023-February/263523.html

---
 app/test/meson.build          |  1 +
 app/test/test_service_cores.c | 32 +++++++++++++++++++++++++++-----
 2 files changed, 28 insertions(+), 5 deletions(-)
app/test/meson.build +1 -0
index f34d19e3c3..2db5ccf4ff 100644
@@ -287,6 +287,7 @@ perf_test_names = [
         'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
+        'service_perf_autotest',
         'stack_perf_autotest',
         'stack_lf_perf_autotest',
         'rand_perf_autotest',
app/test/test_service_cores.c +27 -5
index 637fcd7cf9..06653dfdef 100644
@@ -1022,17 +1022,12 @@ static struct unit_test_suite service_tests  = {
 		TEST_CASE_ST(dummy_register, NULL, service_name),
 		TEST_CASE_ST(dummy_register, NULL, service_get_by_name),
 		TEST_CASE_ST(dummy_register, NULL, service_dump),
-		TEST_CASE_ST(dummy_register, NULL, service_attr_get),
-		TEST_CASE_ST(dummy_register, NULL, service_lcore_attr_get),
 		TEST_CASE_ST(dummy_register, NULL, service_probe_capability),
 		TEST_CASE_ST(dummy_register, NULL, service_start_stop),
 		TEST_CASE_ST(dummy_register, NULL, service_lcore_add_del),
-		TEST_CASE_ST(dummy_register, NULL, service_lcore_start_stop),
 		TEST_CASE_ST(dummy_register, NULL, service_lcore_en_dis_able),
 		TEST_CASE_ST(dummy_register, NULL, service_mt_unsafe_poll),
 		TEST_CASE_ST(dummy_register, NULL, service_mt_safe_poll),
-		TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_safe),
-		TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_unsafe),
 		TEST_CASE_ST(dummy_register, NULL, service_may_be_active),
 		TEST_CASE_ST(dummy_register, NULL, service_active_two_cores),
 		TEST_CASES_END() /**< NULL terminate unit test array */
@@ -1046,3 +1041,30 @@ test_service_common(void)
 }
 
 REGISTER_TEST_COMMAND(service_autotest, test_service_common);
+
+
+/* The tests below have been split from the auto-test suite, as the
+ * when they are run in a cloud CI environment they can give false-positive
+ * errors, due to the service-cores not being scheduled by the OS.
+ */
+static struct unit_test_suite service_perf_tests  = {
+	.suite_name = "service core test suite",
+	.setup = testsuite_setup,
+	.teardown = testsuite_teardown,
+	.unit_test_cases = {
+		TEST_CASE_ST(dummy_register, NULL, service_attr_get),
+		TEST_CASE_ST(dummy_register, NULL, service_lcore_attr_get),
+		TEST_CASE_ST(dummy_register, NULL, service_lcore_start_stop),
+		TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_safe),
+		TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_unsafe),
+		TEST_CASES_END() /**< NULL terminate unit test array */
+	}
+};
+
+static int
+test_service_perf(void)
+{
+	return unit_test_suite_runner(&service_perf_tests);
+}
+
+REGISTER_TEST_COMMAND(service_perf_autotest, test_service_perf);
Signature · 1 line
2.34.1
#1 lore raw

Hello,

Quoted 55 lines · Harry van Haaren

On some CI runs, some service-cores tests spuriously fail as the service lcore thread is not actually scheduled by the OS in the given amount of time.

Increasing timeouts has not resolved the issue in the CI, so the solution in this patch is to move them to a separate perf test suite.

---

See DPDK ML discussion in this thread:
http://mails.dpdk.org/archives/dev/2023-February/263523.html

---
 app/test/meson.build          |  1 +
 app/test/test_service_cores.c | 32 +++++++++++++++++++++++++++-----
 2 files changed, 28 insertions(+), 5 deletions(-)
app/test/meson.build +1 -0
index f34d19e3c3..2db5ccf4ff 100644
@@ -287,6 +287,7 @@ perf_test_names = [
         'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
+        'service_perf_autotest',
         'stack_perf_autotest',
         'stack_lf_perf_autotest',
         'rand_perf_autotest',
app/test/test_service_cores.c +0 -5
index 637fcd7cf9..06653dfdef 100644
@@ -1022,17 +1022,12 @@ static struct unit_test_suite service_tests  = {
                TEST_CASE_ST(dummy_register, NULL, service_name),
                TEST_CASE_ST(dummy_register, NULL, service_get_by_name),
                TEST_CASE_ST(dummy_register, NULL, service_dump),
-               TEST_CASE_ST(dummy_register, NULL, service_attr_get),
-               TEST_CASE_ST(dummy_register, NULL, service_lcore_attr_get),
                TEST_CASE_ST(dummy_register, NULL, service_probe_capability),
                TEST_CASE_ST(dummy_register, NULL, service_start_stop),
                TEST_CASE_ST(dummy_register, NULL, service_lcore_add_del),
-               TEST_CASE_ST(dummy_register, NULL, service_lcore_start_stop),
                TEST_CASE_ST(dummy_register, NULL, service_lcore_en_dis_able),
                TEST_CASE_ST(dummy_register, NULL, service_mt_unsafe_poll),
                TEST_CASE_ST(dummy_register, NULL, service_mt_safe_poll),
-               TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_safe),
-               TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_unsafe),
                TEST_CASE_ST(dummy_register, NULL, service_may_be_active),
                TEST_CASE_ST(dummy_register, NULL, service_active_two_cores),
                TEST_CASES_END() /**< NULL terminate unit test array */

app/test/test_service_cores.c test_service_common(void) · line 1046

Quoted 6 lines
app/test/test_service_cores.c +3 -0
@@ -1046,3 +1041,30 @@ test_service_common(void)
 }
 
 REGISTER_TEST_COMMAND(service_autotest, test_service_common);
+
+
+/* The tests below have been split from the auto-test suite, as the

What is the auto-test suite?
Plus "as the when" reads strange.

In the end, I don't think it helps much to have this comment in the code. The commitlog is supposed to tell the story, so I would simply remove this comment.

app/test/test_service_cores.c test_service_common(void) · line 1051

Quoted 5 lines
app/test/test_service_cores.c +5 -0
+ * when they are run in a cloud CI environment they can give false-positive
+ * errors, due to the service-cores not being scheduled by the OS.
+ */
+static struct unit_test_suite service_perf_tests  = {
+       .suite_name = "service core test suite",

Maybe add "performance" in the name, so we have a uniquely named testsuite object.

app/test/test_service_cores.c test_service_common(void) · line 1057

Quoted 6 lines
app/test/test_service_cores.c +6 -0
+       .setup = testsuite_setup,
+       .teardown = testsuite_teardown,
+       .unit_test_cases = {
+               TEST_CASE_ST(dummy_register, NULL, service_attr_get),
+               TEST_CASE_ST(dummy_register, NULL, service_lcore_attr_get),
+               TEST_CASE_ST(dummy_register, NULL, service_lcore_start_stop),

Looking at service_lcore_running_check(), don't you think service_may_be_active() and service_active_two_cores() are also subject to race?

Quoted 16 lines
app/test/test_service_cores.c +13 -1
+               TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_safe),
+               TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_unsafe),
+               TEST_CASES_END() /**< NULL terminate unit test array */
+       }
+};
+
+static int
+test_service_perf(void)
+{
+       return unit_test_suite_runner(&service_perf_tests);
+}
+
+REGISTER_TEST_COMMAND(service_perf_autotest, test_service_perf);
--

2.34.1

Signature · 1 line
David Marchand
#2 lore raw
Quoted 97 lines · David Marchand

Hello,

Quoted 55 lines · Harry van Haaren

On some CI runs, some service-cores tests spuriously fail as the service lcore thread is not actually scheduled by the OS in the given amount of time.

Increasing timeouts has not resolved the issue in the CI, so the solution in this patch is to move them to a separate perf test suite.

---

See DPDK ML discussion in this thread:
http://mails.dpdk.org/archives/dev/2023-February/263523.html

---
 app/test/meson.build          |  1 +
 app/test/test_service_cores.c | 32 +++++++++++++++++++++++++++-----
 2 files changed, 28 insertions(+), 5 deletions(-)
app/test/meson.build +1 -0
index f34d19e3c3..2db5ccf4ff 100644
@@ -287,6 +287,7 @@ perf_test_names = [
         'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
+        'service_perf_autotest',
         'stack_perf_autotest',
         'stack_lf_perf_autotest',
         'rand_perf_autotest',
app/test/test_service_cores.c +0 -5
index 637fcd7cf9..06653dfdef 100644
@@ -1022,17 +1022,12 @@ static struct unit_test_suite service_tests  = {
                TEST_CASE_ST(dummy_register, NULL, service_name),
                TEST_CASE_ST(dummy_register, NULL, service_get_by_name),
                TEST_CASE_ST(dummy_register, NULL, service_dump),
-               TEST_CASE_ST(dummy_register, NULL, service_attr_get),
-               TEST_CASE_ST(dummy_register, NULL, service_lcore_attr_get),
                TEST_CASE_ST(dummy_register, NULL, service_probe_capability),
                TEST_CASE_ST(dummy_register, NULL, service_start_stop),
                TEST_CASE_ST(dummy_register, NULL, service_lcore_add_del),
-               TEST_CASE_ST(dummy_register, NULL, service_lcore_start_stop),
                TEST_CASE_ST(dummy_register, NULL, service_lcore_en_dis_able),
                TEST_CASE_ST(dummy_register, NULL, service_mt_unsafe_poll),
                TEST_CASE_ST(dummy_register, NULL, service_mt_safe_poll),
-               TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_safe),
-               TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_unsafe),
                TEST_CASE_ST(dummy_register, NULL, service_may_be_active),
                TEST_CASE_ST(dummy_register, NULL, service_active_two_cores),
                TEST_CASES_END() /**< NULL terminate unit test array */

app/test/test_service_cores.c test_service_common(void) · line 1046

Quoted 6 lines
app/test/test_service_cores.c +3 -0
@@ -1046,3 +1041,30 @@ test_service_common(void)
 }
 
 REGISTER_TEST_COMMAND(service_autotest, test_service_common);
+
+
+/* The tests below have been split from the auto-test suite, as the

What is the auto-test suite?
Plus "as the when" reads strange.

In the end, I don't think it helps much to have this comment in the code. The commitlog is supposed to tell the story, so I would simply remove this comment.

app/test/test_service_cores.c test_service_common(void) · line 1051

Quoted 5 lines
app/test/test_service_cores.c +5 -0
+ * when they are run in a cloud CI environment they can give false-positive
+ * errors, due to the service-cores not being scheduled by the OS.
+ */
+static struct unit_test_suite service_perf_tests  = {
+       .suite_name = "service core test suite",

Maybe add "performance" in the name, so we have a uniquely named testsuite object.

app/test/test_service_cores.c test_service_common(void) · line 1057

Quoted 6 lines
app/test/test_service_cores.c +6 -0
+       .setup = testsuite_setup,
+       .teardown = testsuite_teardown,
+       .unit_test_cases = {
+               TEST_CASE_ST(dummy_register, NULL, service_attr_get),
+               TEST_CASE_ST(dummy_register, NULL, service_lcore_attr_get),
+               TEST_CASE_ST(dummy_register, NULL, service_lcore_start_stop),

Looking at service_lcore_running_check(), don't you think service_may_be_active() and service_active_two_cores() are also subject to race?

Quoted 16 lines
Quoted 14 lines
app/test/test_service_cores.c +13 -1
+               TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_safe),
+               TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_unsafe),
+               TEST_CASES_END() /**< NULL terminate unit test array */
+       }
+};
+
+static int
+test_service_perf(void)
+{
+       return unit_test_suite_runner(&service_perf_tests);
+}
+
+REGISTER_TEST_COMMAND(service_perf_autotest, test_service_perf);
--
Quoted 2 lines

2.34.1

ping.

Signature · 1 line
David Marchand
#3 lore raw
In reply to David Marchand
Quoted 81 lines

-----Original Message-----
From: David Marchand <[email protected]>
Sent: Monday, February 27, 2023 4:09 PM
To: Van Haaren, Harry <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; mattias.ronnblom <[email protected]>; [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>
Subject: Re: [PATCH] service: split tests to perf and autotest to avoid spurious CI failures

Hello,

Quoted 55 lines · Harry van Haaren

On some CI runs, some service-cores tests spuriously fail as the service lcore thread is not actually scheduled by the OS in the given amount of time.

Increasing timeouts has not resolved the issue in the CI, so the solution in this patch is to move them to a separate perf test suite.

---

See DPDK ML discussion in this thread:
http://mails.dpdk.org/archives/dev/2023-February/263523.html

---
 app/test/meson.build          |  1 +
 app/test/test_service_cores.c | 32 +++++++++++++++++++++++++++-----
 2 files changed, 28 insertions(+), 5 deletions(-)
app/test/meson.build +1 -0
index f34d19e3c3..2db5ccf4ff 100644
@@ -287,6 +287,7 @@ perf_test_names = [
         'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
+        'service_perf_autotest',
         'stack_perf_autotest',
         'stack_lf_perf_autotest',
         'rand_perf_autotest',
app/test/test_service_cores.c +0 -5
index 637fcd7cf9..06653dfdef 100644
@@ -1022,17 +1022,12 @@ static struct unit_test_suite service_tests  = {
                TEST_CASE_ST(dummy_register, NULL, service_name),
                TEST_CASE_ST(dummy_register, NULL, service_get_by_name),
                TEST_CASE_ST(dummy_register, NULL, service_dump),
-               TEST_CASE_ST(dummy_register, NULL, service_attr_get),
-               TEST_CASE_ST(dummy_register, NULL, service_lcore_attr_get),
                TEST_CASE_ST(dummy_register, NULL, service_probe_capability),
                TEST_CASE_ST(dummy_register, NULL, service_start_stop),
                TEST_CASE_ST(dummy_register, NULL, service_lcore_add_del),
-               TEST_CASE_ST(dummy_register, NULL, service_lcore_start_stop),
                TEST_CASE_ST(dummy_register, NULL, service_lcore_en_dis_able),
                TEST_CASE_ST(dummy_register, NULL, service_mt_unsafe_poll),
                TEST_CASE_ST(dummy_register, NULL, service_mt_safe_poll),
-               TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_safe),
-               TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_unsafe),
                TEST_CASE_ST(dummy_register, NULL, service_may_be_active),
                TEST_CASE_ST(dummy_register, NULL, service_active_two_cores),
                TEST_CASES_END() /**< NULL terminate unit test array */

app/test/test_service_cores.c test_service_common(void) · line 1046

Quoted 6 lines
app/test/test_service_cores.c +3 -0
@@ -1046,3 +1041,30 @@ test_service_common(void)
 }
 
 REGISTER_TEST_COMMAND(service_autotest, test_service_common);
+
+
+/* The tests below have been split from the auto-test suite, as the

What is the auto-test suite?
Plus "as the when" reads strange.

Quoted 3 lines

In the end, I don't think it helps much to have this comment in the code. The commitlog is supposed to tell the story, so I would simply remove this comment.

OK, will remove comment.

Quoted 8 lines

app/test/test_service_cores.c test_service_common(void) · line 1051

Quoted 5 lines
app/test/test_service_cores.c +5 -0
+ * when they are run in a cloud CI environment they can give false-positive
+ * errors, due to the service-cores not being scheduled by the OS.
+ */
+static struct unit_test_suite service_perf_tests  = {
+       .suite_name = "service core test suite",

Maybe add "performance" in the name, so we have a uniquely named testsuite object.

Ack.

Quoted 10 lines

app/test/test_service_cores.c test_service_common(void) · line 1057

Quoted 6 lines
app/test/test_service_cores.c +6 -0
+       .setup = testsuite_setup,
+       .teardown = testsuite_teardown,
+       .unit_test_cases = {
+               TEST_CASE_ST(dummy_register, NULL, service_attr_get),
+               TEST_CASE_ST(dummy_register, NULL, service_lcore_attr_get),
+               TEST_CASE_ST(dummy_register, NULL, service_lcore_start_stop),

Looking at service_lcore_running_check(), don't you think service_may_be_active() and service_active_two_cores() are also subject to race?

Perhaps, but those haven't *actually* been failing in any of the reports. I'd prefer leave tests running if they're not causing issues in the CI.

<snip>

V2 patch on the way.

#4 lore raw
Quoted 7 lines · Harry
Quoted 7 lines
Quoted 6 lines
app/test/test_service_cores.c +6 -0
+       .setup = testsuite_setup,
+       .teardown = testsuite_teardown,
+       .unit_test_cases = {
+               TEST_CASE_ST(dummy_register, NULL, service_attr_get),
+               TEST_CASE_ST(dummy_register, NULL, service_lcore_attr_get),
+               TEST_CASE_ST(dummy_register, NULL, service_lcore_start_stop),
Quoted 6 lines
Quoted 3 lines

Looking at service_lcore_running_check(), don't you think service_may_be_active() and service_active_two_cores() are also subject to race?

Perhaps, but those haven't *actually* been failing in any of the reports. I'd prefer leave tests running if they're not causing issues in the CI.

service_may_be_active did fail in the near past (report from October that triggered the discussion and the timeout extension patch). So my fear is that we will see some ocurrences.

Time will tell.

Signature · 1 line
David Marchand
#5 lore raw

PATCH v2 1/1 service: split tests to perf and autotest to avoid spurious CI failures

In reply to Harry van Haaren

On some CI runs, some service-cores tests spuriously fail as the service lcore thread is not actually scheduled by the OS in the given amount of time.

Increasing timeouts has not resolved the issue in the CI, so the solution in this patch is to move them to a separate perf test suite.

---

v2:
- Add "performance" to suite name (David)
- Remove comment above perf-test suite (David)

See DPDK ML discussion in this thread:
http://mails.dpdk.org/archives/dev/2023-February/263523.html

---
 app/test/meson.build          |  1 +
 app/test/test_service_cores.c | 27 ++++++++++++++++++++++-----
 2 files changed, 23 insertions(+), 5 deletions(-)
app/test/meson.build +1 -0
index f34d19e3c3..2db5ccf4ff 100644
@@ -287,6 +287,7 @@ perf_test_names = [
         'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
+        'service_perf_autotest',
         'stack_perf_autotest',
         'stack_lf_perf_autotest',
         'rand_perf_autotest',
app/test/test_service_cores.c +22 -5
index 637fcd7cf9..c8b6a27c69 100644
@@ -1022,17 +1022,12 @@ static struct unit_test_suite service_tests  = {
 		TEST_CASE_ST(dummy_register, NULL, service_name),
 		TEST_CASE_ST(dummy_register, NULL, service_get_by_name),
 		TEST_CASE_ST(dummy_register, NULL, service_dump),
-		TEST_CASE_ST(dummy_register, NULL, service_attr_get),
-		TEST_CASE_ST(dummy_register, NULL, service_lcore_attr_get),
 		TEST_CASE_ST(dummy_register, NULL, service_probe_capability),
 		TEST_CASE_ST(dummy_register, NULL, service_start_stop),
 		TEST_CASE_ST(dummy_register, NULL, service_lcore_add_del),
-		TEST_CASE_ST(dummy_register, NULL, service_lcore_start_stop),
 		TEST_CASE_ST(dummy_register, NULL, service_lcore_en_dis_able),
 		TEST_CASE_ST(dummy_register, NULL, service_mt_unsafe_poll),
 		TEST_CASE_ST(dummy_register, NULL, service_mt_safe_poll),
-		TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_safe),
-		TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_unsafe),
 		TEST_CASE_ST(dummy_register, NULL, service_may_be_active),
 		TEST_CASE_ST(dummy_register, NULL, service_active_two_cores),
 		TEST_CASES_END() /**< NULL terminate unit test array */
@@ -1046,3 +1041,25 @@ test_service_common(void)
 }
 
 REGISTER_TEST_COMMAND(service_autotest, test_service_common);
+
+static struct unit_test_suite service_perf_tests  = {
+	.suite_name = "service core performance test suite",
+	.setup = testsuite_setup,
+	.teardown = testsuite_teardown,
+	.unit_test_cases = {
+		TEST_CASE_ST(dummy_register, NULL, service_attr_get),
+		TEST_CASE_ST(dummy_register, NULL, service_lcore_attr_get),
+		TEST_CASE_ST(dummy_register, NULL, service_lcore_start_stop),
+		TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_safe),
+		TEST_CASE_ST(dummy_register, NULL, service_app_lcore_mt_unsafe),
+		TEST_CASES_END() /**< NULL terminate unit test array */
+	}
+};
+
+static int
+test_service_perf(void)
+{
+	return unit_test_suite_runner(&service_perf_tests);
+}
+
+REGISTER_TEST_COMMAND(service_perf_autotest, test_service_perf);
Signature · 1 line
2.34.1
#6 lore raw
Quoted 10 lines · Harry van Haaren

On some CI runs, some service-cores tests spuriously fail as the service lcore thread is not actually scheduled by the OS in the given amount of time.

Increasing timeouts has not resolved the issue in the CI, so the solution in this patch is to move them to a separate perf test suite.

Applied, thanks.

Signature · 1 line
David Marchand