Skip to content

Commit 365836e

Browse files
Yunshui Jiangkuba-moo
authored andcommitted
tests: hsr: Increase timeout to 50 seconds
The HSR test, hsr_ping.sh, actually needs 7 min to run. Around 375s to be exact, and even more on a debug kernel or kernel with other network security limits. The timeout setting for the kselftest is currently 45 seconds, which is way too short to integrate hsr tests to run_kselftest infrastructure. However, timeout of hundreds of seconds is quite a long time, especially in a CI/CD environment. It seems that we need accelerate the test and balance with timeout setting. The most time-consuming func is do_ping_long, where ping command sends 10 packages to the given address. The default interval between two ping packages is 1s according to the ping Mannual. There isn't any operation between pings thus we could pass -i 0.1 to ping to make it 10 times faster. While even with this short interval, the test still need about 46.4 seconds to finish because of the two HSR interfaces, each of which is tested by calling do_ping func 12 times and do_ping_long func 19 times and sleep for 3s. So, an explicit setting is also needed to slightly increase the timeout. And to leave us some slack, use 50 as default timeout. Signed-off-by: Yunshui Jiang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d30b56c commit 365836e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tools/testing/selftests/net/hsr/hsr_common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ do_ping()
1515
{
1616
local netns="$1"
1717
local connect_addr="$2"
18-
local ping_args="-q -c 2"
18+
local ping_args="-q -c 2 -i 0.1"
1919

2020
if is_v6 "${connect_addr}"; then
2121
$ipv6 || return 0
@@ -36,7 +36,7 @@ do_ping_long()
3636
{
3737
local netns="$1"
3838
local connect_addr="$2"
39-
local ping_args="-q -c 10"
39+
local ping_args="-q -c 10 -i 0.1"
4040

4141
if is_v6 "${connect_addr}"; then
4242
$ipv6 || return 0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
timeout=50

0 commit comments

Comments
 (0)