From 887953c990c51f15ed34e5aed8020503fcc9655d 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 | 11 ++++++++++- libc/test.yaml | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/libc/socket/unix-socket.c b/libc/socket/unix-socket.c index adb11a4f..30d63703 100644 --- a/libc/socket/unix-socket.c +++ b/libc/socket/unix-socket.c @@ -36,6 +36,7 @@ char data[DATA_SIZE]; char buf[DATA_SIZE]; +int pollTimeoutDiff = 30; ssize_t unix_named_socket(int type, const char *name) @@ -859,7 +860,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 + pollTimeoutDiff, ms); TEST_ASSERT_GREATER_THAN(290, ms); clock_gettime(CLOCK_REALTIME, &ts[0]); @@ -930,6 +931,14 @@ void runner(void) int main(int argc, char *argv[]) { + /* Custom value (ms) added to timeout in assert since blocking interval + * significantly overruns this timeout due to big kernel scheduling delays on some targets. + * Typical for emulated targets. + */ + if (argc == 2) { + pollTimeoutDiff = atoi(argv[1]); + } + /* Assume /tmp dir is missing */ int isMissing = 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: