Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/bpf: Adding delay in socketmap_listen to reduce flakyness

This patch adds a 1ms delay to reduce flakyness of the test.

Signed-off-by: Yucong Sun <fallentree@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210819163609.2583758-1-fallentree@fb.com

authored by

Yucong Sun and committed by
Andrii Nakryiko
3666b167 594286b7

+9 -3
+9 -3
tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
··· 1603 1603 again: 1604 1604 n = read(mode == REDIR_INGRESS ? p0 : c0, &b, 1); 1605 1605 if (n < 0) { 1606 - if (errno == EAGAIN && retries--) 1606 + if (errno == EAGAIN && retries--) { 1607 + usleep(1000); 1607 1608 goto again; 1609 + } 1608 1610 FAIL_ERRNO("%s: read", log_prefix); 1609 1611 } 1610 1612 if (n == 0) ··· 1778 1776 again: 1779 1777 n = read(mode == REDIR_INGRESS ? p0 : c0, &b, 1); 1780 1778 if (n < 0) { 1781 - if (errno == EAGAIN && retries--) 1779 + if (errno == EAGAIN && retries--) { 1780 + usleep(1000); 1782 1781 goto again; 1782 + } 1783 1783 FAIL_ERRNO("%s: read", log_prefix); 1784 1784 } 1785 1785 if (n == 0) ··· 1873 1869 again: 1874 1870 n = read(mode == REDIR_INGRESS ? p0 : c0, &b, 1); 1875 1871 if (n < 0) { 1876 - if (errno == EAGAIN && retries--) 1872 + if (errno == EAGAIN && retries--) { 1873 + usleep(1000); 1877 1874 goto again; 1875 + } 1878 1876 FAIL_ERRNO("%s: read", log_prefix); 1879 1877 } 1880 1878 if (n == 0)