Skip to content

Commit

Permalink
libc: add passing custom parameter to unix-socket test on armv7a9-zyn…
Browse files Browse the repository at this point in the history
…q7000-qemu since

      blocking interval significantly overruns timeout due to big kernel scheduling delays

JIRA: CI-501
  • Loading branch information
adamdebek committed Oct 7, 2024
1 parent c3b2ba6 commit 887953c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libc/socket/unix-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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;

Expand Down
8 changes: 8 additions & 0 deletions libc/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 887953c

Please sign in to comment.