All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] selftests: net: fib_nexthops: Wait before checking reported idle time
@ 2021-09-24 10:04 Petr Machata
  2021-09-27 11:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Machata @ 2021-09-24 10:04 UTC (permalink / raw)
  To: netdev; +Cc: David S . Miller, Jakub Kicinski, Petr Machata

The purpose of this test is to verify that after a short activity passes,
the reported time is reasonable: not zero (which could be reported by
mistake), and not something outrageous (which would be indicative of an
issue in used units).

However, the idle time is reported in units of clock_t, or hundredths of
second. If the initial sequence of commands is very quick, it is possible
that the idle time is reported as just flat-out zero. When this test was
recently enabled in our nightly regression, we started seeing spurious
failures for exactly this reason.

Therefore buffer the delay leading up to the test with a sleep, to make
sure there is no legitimate way of reporting 0.

Signed-off-by: Petr Machata <petrm@nvidia.com>
---
 tools/testing/selftests/net/fib_nexthops.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/net/fib_nexthops.sh b/tools/testing/selftests/net/fib_nexthops.sh
index 0d293391e9a4..b5a69ad191b0 100755
--- a/tools/testing/selftests/net/fib_nexthops.sh
+++ b/tools/testing/selftests/net/fib_nexthops.sh
@@ -2078,6 +2078,7 @@ basic_res()
 		"id 101 index 0 nhid 2 id 101 index 1 nhid 2 id 101 index 2 nhid 1 id 101 index 3 nhid 1"
 	log_test $? 0 "Dump all nexthop buckets in a group"
 
+	sleep 0.1
 	(( $($IP -j nexthop bucket list id 101 |
 	     jq '[.[] | select(.bucket.idle_time > 0 and
 	                       .bucket.idle_time < 2)] | length') == 4 ))
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] selftests: net: fib_nexthops: Wait before checking reported idle time
  2021-09-24 10:04 [PATCH net-next] selftests: net: fib_nexthops: Wait before checking reported idle time Petr Machata
@ 2021-09-27 11:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-27 11:20 UTC (permalink / raw)
  To: Petr Machata; +Cc: netdev, davem, kuba

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Fri, 24 Sep 2021 12:04:27 +0200 you wrote:
> The purpose of this test is to verify that after a short activity passes,
> the reported time is reasonable: not zero (which could be reported by
> mistake), and not something outrageous (which would be indicative of an
> issue in used units).
> 
> However, the idle time is reported in units of clock_t, or hundredths of
> second. If the initial sequence of commands is very quick, it is possible
> that the idle time is reported as just flat-out zero. When this test was
> recently enabled in our nightly regression, we started seeing spurious
> failures for exactly this reason.
> 
> [...]

Here is the summary with links:
  - [net-next] selftests: net: fib_nexthops: Wait before checking reported idle time
    https://git.kernel.org/netdev/net-next/c/b69c99463d41

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-27 11:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24 10:04 [PATCH net-next] selftests: net: fib_nexthops: Wait before checking reported idle time Petr Machata
2021-09-27 11:20 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.