diff mbox series

[ovs-dev] system-tests: Reduce flakiness of ACL reject tests

Message ID 20230221123856.276545-1-amusil@redhat.com
State Accepted
Headers show
Series [ovs-dev] system-tests: Reduce flakiness of ACL reject tests | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Ales Musil Feb. 21, 2023, 12:38 p.m. UTC
The tests are looking for specific output from tcpdump
counting number of occurrences and expecting only 1. It
might happen that in the time period there are already two
or more packets and the test simply fails. Change the condition
to be greater or equal to one.

Signed-off-by: Ales Musil <amusil@redhat.com>
---
 tests/system-ovn.at | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

Comments

Simon Horman March 1, 2023, 8:18 a.m. UTC | #1
On Tue, Feb 21, 2023 at 01:38:56PM +0100, Ales Musil wrote:
> The tests are looking for specific output from tcpdump
> counting number of occurrences and expecting only 1. It
> might happen that in the time period there are already two
> or more packets and the test simply fails. Change the condition
> to be greater or equal to one.
> 
> Signed-off-by: Ales Musil <amusil@redhat.com>

Thanks, this looks good to me.

Reviewed-by: Simon Horman <simon.horman@corigine.com>

I have also tested that it significantly improves the reliability of:

check-kernel: 100 times without this failure mode [*]
check-system-userspace: 736 times

Tested-by: Simon Horman <simon.horman@corigine.com>


[*] I saw this failure once, but I think it relates to contention
    on the very low-end test environment I was using.

...
./system-ovn.at:4989: ip link set sw0-p2-rej netns sw0-p2-rej
./system-ovn.at:4989: ip link set dev ovs-sw0-p2-rej up
./system-ovn.at:4989: ovs-vsctl add-port br-int ovs-sw0-p2-rej -- \
                set interface ovs-sw0-p2-rej external-ids:iface-id="sw0-p2-rej"
--- /dev/null   2023-02-28 09:05:52.600000000 +0000
+++ /home/horms/ovn/tests/system-kmod-testsuite.dir/at-groups/118/stderr        2023-02-28 16:17:58.662282764 +0000
@@ -0,0 +1,4 @@
+2023-02-28T16:17:58Z|00002|timeval|WARN|Unreasonably long 2949ms poll interval (19ms user, 241ms system)
+2023-02-28T16:17:58Z|00003|timeval|WARN|faults: 147 minor, 815 major
+2023-02-28T16:17:58Z|00004|timeval|WARN|disk: 170808 reads, 0 writes
+2023-02-28T16:17:58Z|00005|timeval|WARN|context switches: 828 voluntary, 305 involuntary
Dumitru Ceara March 2, 2023, 2:21 p.m. UTC | #2
On 3/1/23 09:18, Simon Horman wrote:
> On Tue, Feb 21, 2023 at 01:38:56PM +0100, Ales Musil wrote:
>> The tests are looking for specific output from tcpdump
>> counting number of occurrences and expecting only 1. It
>> might happen that in the time period there are already two
>> or more packets and the test simply fails. Change the condition
>> to be greater or equal to one.
>>
>> Signed-off-by: Ales Musil <amusil@redhat.com>
> 
> Thanks, this looks good to me.
> 
> Reviewed-by: Simon Horman <simon.horman@corigine.com>
> 
> I have also tested that it significantly improves the reliability of:
> 
> check-kernel: 100 times without this failure mode [*]
> check-system-userspace: 736 times
> 
> Tested-by: Simon Horman <simon.horman@corigine.com>
> 

Thanks for testing/review and for the patch!

I applied this to the main branch and backported to all stable branches
down to 21.12.

Regards,
Dumitru
diff mbox series

Patch

diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index 563858e70..281c2bc41 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -5135,7 +5135,7 @@  OVS_WAIT_UNTIL([
     ip netns exec sw0-p1-rej nc -u 10.0.0.4 90 < foo
     c=$(cat sw0-p1-rej-icmp.pcap | grep \
 "10.0.0.4 > 10.0.0.3: ICMP 10.0.0.4 udp port 90 unreachable" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 
 kill $(pidof tcpdump)
@@ -5148,7 +5148,7 @@  OVS_WAIT_UNTIL([
     ip netns exec sw0-p1-rej nc -u 10.0.0.4 94 < foo
     c=$(cat sw0-p1-rej-icmp.pcap | grep \
 "10.0.0.4 > 10.0.0.3: ICMP 10.0.0.4 udp port 94 unreachable" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 kill $(pidof tcpdump)
 
@@ -5161,7 +5161,7 @@  OVS_WAIT_UNTIL([
     c=$(cat sw0-p2-rej-icmp6.pcap | grep \
 "IP6 aef0::3 > aef0::4: ICMP6, destination unreachable, unreachable port, \
 aef0::3 udp port 90" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 
 kill $(pidof tcpdump)
@@ -5175,7 +5175,7 @@  OVS_WAIT_UNTIL([
     c=$(cat sw0-p2-rej-icmp6.pcap | grep \
 "IP6 aef0::3 > aef0::4: ICMP6, destination unreachable, unreachable port, \
 aef0::3 udp port 94" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 kill $(pidof tcpdump)
 
@@ -5201,7 +5201,7 @@  OVS_WAIT_UNTIL([
     ip netns exec sw0-p1-rej nc -u 10.0.0.4 90 < foo
     c=$(cat sw0-p1-rej-icmp.pcap | grep \
 "10.0.0.4 > 10.0.0.3: ICMP 10.0.0.4 udp port 90 unreachable" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 
 kill $(pidof tcpdump)
@@ -5214,7 +5214,7 @@  OVS_WAIT_UNTIL([
     c=$(cat sw0-p2-rej-icmp6.pcap | grep \
 "IP6 aef0::3 > aef0::4: ICMP6, destination unreachable, unreachable port, \
 aef0::3 udp port 90" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 kill $(pidof tcpdump)
 
@@ -5385,7 +5385,7 @@  OVS_WAIT_UNTIL([
     ip netns exec sw0-p1-rej nc -u 10.0.0.4 90 < foo
     c=$(cat sw0-p1-rej-icmp.pcap | grep \
 "10.0.0.4 > 10.0.0.3: ICMP 10.0.0.4 udp port 90 unreachable" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 
 kill $(pidof tcpdump)
@@ -5398,7 +5398,7 @@  OVS_WAIT_UNTIL([
     ip netns exec sw0-p1-rej nc -u 10.0.0.4 94 < foo
     c=$(cat sw0-p1-rej-icmp.pcap | grep \
 "10.0.0.4 > 10.0.0.3: ICMP 10.0.0.4 udp port 94 unreachable" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 
 kill $(pidof tcpdump)
@@ -5412,7 +5412,7 @@  OVS_WAIT_UNTIL([
     c=$(cat sw0-p2-rej-icmp6.pcap | grep \
 "IP6 aef0::3 > aef0::4: ICMP6, destination unreachable, unreachable port, \
 aef0::3 udp port 90" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 
 kill $(pidof tcpdump)
@@ -5426,7 +5426,7 @@  OVS_WAIT_UNTIL([
     c=$(cat sw0-p2-rej-icmp6.pcap | grep \
 "IP6 aef0::3 > aef0::4: ICMP6, destination unreachable, unreachable port, \
 aef0::3 udp port 94" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 
 # Delete all the ACLs of pg0 and add the ACL with a generic match with reject action.
@@ -5452,7 +5452,7 @@  OVS_WAIT_UNTIL([
     ip netns exec sw0-p1-rej nc -u 10.0.0.4 90 < foo
     c=$(cat sw0-p1-rej-icmp.pcap | grep \
 "10.0.0.4 > 10.0.0.3: ICMP 10.0.0.4 udp port 90 unreachable" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 
 kill $(pidof tcpdump)
@@ -5465,7 +5465,7 @@  OVS_WAIT_UNTIL([
     c=$(cat sw0-p2-rej-icmp6.pcap | grep \
 "IP6 aef0::3 > aef0::4: ICMP6, destination unreachable, unreachable port, \
 aef0::3 udp port 90" | uniq | wc -l)
-    test $c -eq 1
+    test $c -ge 1
 ])
 
 kill $(pidof tcpdump)