Skip to content

Commit b69c994

Browse files
pmachatadavem330
authored andcommitted
selftests: net: fib_nexthops: Wait before checking reported idle time
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> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d59bdda commit b69c994

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎tools/testing/selftests/net/fib_nexthops.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,6 +2078,7 @@ basic_res()
20782078
"id 101 index 0 nhid 2 id 101 index 1 nhid 2 id 101 index 2 nhid 1 id 101 index 3 nhid 1"
20792079
log_test $? 0 "Dump all nexthop buckets in a group"
20802080

2081+
sleep 0.1
20812082
(( $($IP -j nexthop bucket list id 101 |
20822083
jq '[.[] | select(.bucket.idle_time > 0 and
20832084
.bucket.idle_time < 2)] | length') == 4 ))

0 commit comments

Comments
 (0)