Skip to content

Commit

Permalink
connectivity: don't configure both timeout and deadline for ping
Browse files Browse the repository at this point in the history
Currently, we configure both the timeout (-W) and the deadline (-w) for
the ping command, with defaults respectively 2 and 10 seconds. Yet, it
appears that the deadline always takes precedence if both are set, which
leads the test to require by default 10 seconds when a network policy
preventing connectivity is in place. Hence, let's configure only the
timeout, so that we stop waiting after two seconds. This is consistent
with the behavior for the curl operations when connectivity is blocked.

Signed-off-by: Marco Iorio <[email protected]>
  • Loading branch information
giorio94 authored and nathanjsweet committed Feb 23, 2024
1 parent 9ade036 commit 6349fd4
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions connectivity/check/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -1073,9 +1073,6 @@ func (ct *ConnectivityTest) PingCommand(peer TestPeer, ipFam features.IPFamily)
if connectTimeout := ct.params.ConnectTimeout.Seconds(); connectTimeout > 0.0 {
cmd = append(cmd, "-W", strconv.FormatFloat(connectTimeout, 'f', -1, 64))
}
if requestTimeout := ct.params.RequestTimeout.Seconds(); requestTimeout > 0.0 {
cmd = append(cmd, "-w", strconv.FormatFloat(requestTimeout, 'f', -1, 64))
}

cmd = append(cmd, peer.Address(ipFam))
return cmd
Expand Down

0 comments on commit 6349fd4

Please sign in to comment.