[1/1] test/memcpy: reduce duration

Message ID 20251031114310.4062899-1-thomas@monjalon.net (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series [1/1] test/memcpy: reduce duration |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Functional success Functional Testing PASS
ci/loongarch-compilation success Compilation OK
ci/iol-marvell-Functional success Functional Testing PASS
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-sample-apps-testing warning Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing warning Testing issues
ci/iol-unit-amd64-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/github-robot-post success github post: success
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/intel-Testing success Testing PASS

Commit Message

Thomas Monjalon Oct. 31, 2025, 11:43 a.m. UTC
When running on limited platforms like GitHub Actions,
the functional unit test "memcpy_autotest"
may hit a timeout, especially when running with UBSan.

This change skips testing some alignment offsets (from 0 to 31).
It will test only every 3-byte offsets for the source buffer,
and every 2-byte offsets for the destination buffer.
So it is supposed to be 6x faster with a reasonably smaller coverage.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test/test_memcpy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Morten Brørup Oct. 31, 2025, 11:48 a.m. UTC | #1
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Friday, 31 October 2025 12.43
> 
> When running on limited platforms like GitHub Actions,
> the functional unit test "memcpy_autotest"
> may hit a timeout, especially when running with UBSan.
> 
> This change skips testing some alignment offsets (from 0 to 31).
> It will test only every 3-byte offsets for the source buffer,
> and every 2-byte offsets for the destination buffer.
> So it is supposed to be 6x faster with a reasonably smaller coverage.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---

Seems reasonable.
Acked-by: Morten Brørup <mb@smartsharesystems.com>
  

Patch

diff --git a/app/test/test_memcpy.c b/app/test/test_memcpy.c
index 802dc4631b..ea9e76e9ad 100644
--- a/app/test/test_memcpy.c
+++ b/app/test/test_memcpy.c
@@ -105,8 +105,8 @@  func_test(void)
 	unsigned int off_src, off_dst, i;
 	int ret;
 
-	for (off_src = 0; off_src < ALIGNMENT_UNIT; off_src++) {
-		for (off_dst = 0; off_dst < ALIGNMENT_UNIT; off_dst++) {
+	for (off_src = 0; off_src < ALIGNMENT_UNIT; off_src += 3) {
+		for (off_dst = 0; off_dst < ALIGNMENT_UNIT; off_dst += 2) {
 			for (i = 0; i < RTE_DIM(buf_sizes); i++) {
 				ret = test_single_memcpy(off_src, off_dst,
 				                         buf_sizes[i]);