Skip to contentSkip to conversation

arm64 CI stabilize

PATCH Superseded Ruifeng Wang 2 participants 8 messages Apr 24, 2020 – Jul 27, 2020

lore
Share & tools
lore
#0 lore raw

cover arm64 CI stabilize

arm64 Travis CI uses container environment.
Because performance of the environment has fluctuation, false positive failures and time outs happened from time to time. This patch series relax test criteria to stablize test result.

Ruifeng Wang (4):
test/cycles: restore original delay function test/cycles: increase threshold for containers on aarch64
ci: expose test time out argument
ci: increase time out multiplier for containers on aarch64

 .ci/linux-build.sh     |  3 ++-
 .travis.yml            |  4 ++--
 app/test/test_cycles.c | 15 ++++++++++++++-
 3 files changed, 18 insertions(+), 4 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/4 test/cycles: restore original delay function

test_delay_us_sleep registers sleep based delay for testing. The change of default delay function is not expected.

Restore defalut delay function to fix the issue.

Fixes a51639cc720a ("eal: add nanosleep based delay function")
---
 app/test/test_cycles.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
app/test/test_cycles.c +7 -1
index c78e6a5b1..015a9290f 100644
@@ -79,8 +79,14 @@ REGISTER_TEST_COMMAND(cycles_autotest, test_cycles);
 static int
 test_delay_us_sleep(void)
 {
+	int rv = 0;
+
 	rte_delay_us_callback_register(rte_delay_us_sleep);
-	return check_wait_one_second();
+	rv = check_wait_one_second();
+	/* restore original delay function */
+	rte_delay_us_callback_register(rte_delay_us_block);
+
+	return rv;
 }
 
 REGISTER_TEST_COMMAND(delay_us_sleep_autotest, test_delay_us_sleep);
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/4 test/cycles: increase threshold for containers on aarch64

In reply to Ruifeng Wang

rte_delay_us_xxx could have more deviation than expected when system load is high. Test case failures were observed on Travis CI which run unit test in container for aarch64.

Use looser criteria for cycle tests on aarch64.

---
 app/test/test_cycles.c | 7 +++++++
 1 file changed, 7 insertions(+)
app/test/test_cycles.c +7 -0
index 015a9290f..52bc9af81 100644
@@ -30,6 +30,13 @@ check_wait_one_second(void)
 	uint64_t hz = rte_get_timer_hz();
 	uint64_t max_inc = (hz / 100); /* 10 ms max between 2 reads */
 
+#if defined(RTE_ARCH_ARM64)
+	/* When testing in containers, 'delay' could have less accuracy
+	 * if system is busy.
+	 */
+	max_inc = 3 * max_inc;
+#endif
+
 	/* check that waiting 1 second is precise */
 	prev_cycles = rte_get_timer_cycles();
 	rte_delay_us(1000000);
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/4 ci: expose test time out argument

In reply to Ruifeng Wang

The unit test time out setting was the same for jobs on different platforms. Due to difference of running environments, platforms could have different time out expecations.

Provide TIMEOUT_FACTOR as a knob to change the time out setting.

---
 .ci/linux-build.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
.ci/linux-build.sh +2 -1
index d079801d7..b653de97c 100755
@@ -96,5 +96,6 @@ if [ "$ABI_CHECKS" = "1" ]; then
 fi
 
 if [ "$RUN_TESTS" = "1" ]; then
-    sudo meson test -C build --suite fast-tests -t 3
+    TIMEOUT_FACTOR=${TIMEOUT_FACTOR:-3}
+    sudo meson test -C build --suite fast-tests -t $TIMEOUT_FACTOR
 fi
Signature · 1 line
2.17.1
#4 lore raw

PATCH 4/4 ci: increase time out multiplier for containers on aarch64

In reply to Ruifeng Wang

aarch64 jobs are running in containers. Tests may take longer time when system load is high.

Use bigger time out value for aarch64 test jobs to stabilize test result.

---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
.travis.yml +2 -2
index 2d2292ff6..e8a4b99b0 100644
@@ -105,7 +105,7 @@ jobs:
   - env: DEF_LIB="static"
     arch: arm64
     compiler: gcc
-  - env: DEF_LIB="shared" RUN_TESTS=1
+  - env: DEF_LIB="shared" RUN_TESTS=1 TIMEOUT_FACTOR=9
     arch: arm64
     compiler: gcc
   - env: DEF_LIB="shared" BUILD_DOCS=1
@@ -128,6 +128,6 @@ jobs:
   - env: DEF_LIB="static"
     arch: arm64
     compiler: clang
-  - env: DEF_LIB="shared" RUN_TESTS=1
+  - env: DEF_LIB="shared" RUN_TESTS=1 TIMEOUT_FACTOR=9
     arch: arm64
     compiler: clang
Signature · 1 line
2.17.1
#5 lore raw

PATCH v2 1/1 test/cycles: restore original delay function

In reply to Ruifeng Wang

test_delay_us_sleep registers sleep based delay for testing. This changes the default delay function of testing environment. It is not expected.

Restore defalut delay function after the test to fix the issue.

Fixes a51639cc720a ("eal: add nanosleep based delay function")

---
v2:
Dropped other patches in the series that are not needed.

 app/test/test_cycles.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
app/test/test_cycles.c +7 -1
index c78e6a5b1..015a9290f 100644
@@ -79,8 +79,14 @@ REGISTER_TEST_COMMAND(cycles_autotest, test_cycles);
 static int
 test_delay_us_sleep(void)
 {
+	int rv = 0;
+
 	rte_delay_us_callback_register(rte_delay_us_sleep);
-	return check_wait_one_second();
+	rv = check_wait_one_second();
+	/* restore original delay function */
+	rte_delay_us_callback_register(rte_delay_us_block);
+
+	return rv;
 }
 
 REGISTER_TEST_COMMAND(delay_us_sleep_autotest, test_delay_us_sleep);
Signature · 1 line
2.17.1
#6 lore raw

PATCH v2 1/1 test/cycles: restore original delay function

In reply to Ruifeng Wang

test_delay_us_sleep registers sleep based delay for testing. This changes the default delay function of testing environment. It is not expected.

Restore default delay function after the test to fix the issue.

Fixes a51639cc720a ("eal: add nanosleep based delay function")

---
v2:
Dropped other patches in the series that are not needed.

 app/test/test_cycles.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
app/test/test_cycles.c +7 -1
index c78e6a5b1..015a9290f 100644
@@ -79,8 +79,14 @@ REGISTER_TEST_COMMAND(cycles_autotest, test_cycles);
 static int
 test_delay_us_sleep(void)
 {
+	int rv = 0;
+
 	rte_delay_us_callback_register(rte_delay_us_sleep);
-	return check_wait_one_second();
+	rv = check_wait_one_second();
+	/* restore original delay function */
+	rte_delay_us_callback_register(rte_delay_us_block);
+
+	return rv;
 }
 
 REGISTER_TEST_COMMAND(delay_us_sleep_autotest, test_delay_us_sleep);
Signature · 1 line
2.17.1
Reviewed-by on v2 1/1 Applied
#7 lore raw

Re: [dpdk-dev] [PATCH v2] test/cycles: restore original delay function

Quoted 24 lines · Ruifeng Wang

test_delay_us_sleep registers sleep based delay for testing. This changes the default delay function of testing environment. It is not expected.

Restore default delay function after the test to fix the issue.

Fixes a51639cc720a ("eal: add nanosleep based delay function")

---
v2:
Dropped other patches in the series that are not needed.

 app/test/test_cycles.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
app/test/test_cycles.c +0 -0
index c78e6a5b1..015a9290f 100644

app/test/test_cycles.c REGISTER_TEST_COMMAND(cycles_autotest, test_cycles); · line 82

Quoted 4 lines
app/test/test_cycles.c +1 -0
@@ -79,8 +79,14 @@ REGISTER_TEST_COMMAND(cycles_autotest, test_cycles);
 static int
 test_delay_us_sleep(void)
 {
+       int rv = 0;

No initialisation needed, I removed it while applying.

app/test/test_cycles.c REGISTER_TEST_COMMAND(cycles_autotest, test_cycles); · line 92

Quoted 11 lines
app/test/test_cycles.c +6 -1
+
        rte_delay_us_callback_register(rte_delay_us_sleep);
-       return check_wait_one_second();
+       rv = check_wait_one_second();
+       /* restore original delay function */
+       rte_delay_us_callback_register(rte_delay_us_block);
+
+       return rv;
 }
 
 REGISTER_TEST_COMMAND(delay_us_sleep_autotest, test_delay_us_sleep);

Applied, thanks.

Signature · 1 line
David Marchand