From 371e86177b41ae3cf14226dd536450b378e9d82b Mon Sep 17 00:00:00 2001 From: adamdebek Date: Mon, 7 Oct 2024 14:22:53 +0200 Subject: [PATCH] libc: add passing custom parameter to unix-socket test on armv7a9-zynq7000-qemu since blocking interval significantly overruns timeout due to big kernel scheduling delays JIRA: CI-501 --- libc/socket/unix-socket.c | 7 ++++++- libc/test.yaml | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libc/socket/unix-socket.c b/libc/socket/unix-socket.c index adb11a4f..93aa2c38 100644 --- a/libc/socket/unix-socket.c +++ b/libc/socket/unix-socket.c @@ -830,6 +830,11 @@ void unix_poll(int type) struct pollfd fds[2]; struct timespec ts[2]; int rv, ms; + int timeoutDiff = 30; + + if (argc == 2) { + timeoutDiff = atoi(argv[1]); + } fds[0].fd = 11111; fds[1].fd = 22222; @@ -859,7 +864,7 @@ void unix_poll(int type) TEST_ASSERT(rv == 0); TEST_ASSERT(fds[0].revents == 0); TEST_ASSERT(fds[1].revents == 0); - TEST_ASSERT_LESS_THAN(350, ms); + TEST_ASSERT_LESS_THAN(300 + timeoutDiff, ms); TEST_ASSERT_GREATER_THAN(290, ms); clock_gettime(CLOCK_REALTIME, &ts[0]); diff --git a/libc/test.yaml b/libc/test.yaml index 0f96e676..83700ebd 100644 --- a/libc/test.yaml +++ b/libc/test.yaml @@ -66,8 +66,16 @@ test: - name: unix-socket execute: test-libc-unix-socket targets: + exclude: [armv7a9-zynq7000-qemu] include: [host-generic-pc] + - name: unix-socket + # This parameter is custom value (ms) added to timeout in assert since blocking interval + # significantly overruns this timeout due to big kernel scheduling delays on this target + execute: test-libc-unix-socket 100 + targets: + value: [armv7a9-zynq7000-qemu] + - name: inet-socket execute: test-libc-inet-socket targets: