diff mbox series

[ovs-dev] ovn-sbctl.at: Fix timing problem of count-flows test.

Message ID 20210715233451.2427987-1-hzhou@ovn.org
State Accepted
Headers show
Series [ovs-dev] ovn-sbctl.at: Fix timing problem of count-flows test. | 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

Han Zhou July 15, 2021, 11:34 p.m. UTC
Fixes: 895e02ec0be6("ovn-sbctl.c Add logical flows count numbers")
Signed-off-by: Han Zhou <hzhou@ovn.org>
---
 tests/ovn-sbctl.at | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ben Pfaff July 15, 2021, 11:57 p.m. UTC | #1
On Thu, Jul 15, 2021 at 04:34:51PM -0700, Han Zhou wrote:
> Fixes: 895e02ec0be6("ovn-sbctl.c Add logical flows count numbers")
> Signed-off-by: Han Zhou <hzhou@ovn.org>
> ---
>  tests/ovn-sbctl.at | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at
> index 16f5dabcc..dabf62d2b 100644
> --- a/tests/ovn-sbctl.at
> +++ b/tests/ovn-sbctl.at
> @@ -200,7 +200,7 @@ Total number of logical flows = 0
>  ])
>  
>  # create some logical flows
> -check ovn-nbctl ls-add count-test
> +check ovn-nbctl --wait=sb ls-add count-test
>  
>  OVS_WAIT_UNTIL([total_lflows=`count_entries`; test $total_lflows -ne 0])

I'm surprised that the above change is needed, since OVS_WAIT_UNTIL
should wait until the condition is true.

> @@ -219,7 +219,7 @@ $ingress_lflows
>  ])
>  
>  # add another datapath
> -check ovn-nbctl ls-add count-test2
> +check ovn-nbctl --wait=sb ls-add count-test2
>  
>  # check total logical flows in 2 datapathes
>  AT_CHECK_UNQUOTED([ovn-sbctl count-flows | grep "flows =" | awk 'NF>1{print $NF}'], [0], [dnl

The one above makes sense to me.
Han Zhou July 16, 2021, 1:10 a.m. UTC | #2
On Thu, Jul 15, 2021 at 4:57 PM Ben Pfaff <blp@ovn.org> wrote:

> On Thu, Jul 15, 2021 at 04:34:51PM -0700, Han Zhou wrote:
> > Fixes: 895e02ec0be6("ovn-sbctl.c Add logical flows count numbers")
> > Signed-off-by: Han Zhou <hzhou@ovn.org>
> > ---
> >  tests/ovn-sbctl.at | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at
> > index 16f5dabcc..dabf62d2b 100644
> > --- a/tests/ovn-sbctl.at
> > +++ b/tests/ovn-sbctl.at
> > @@ -200,7 +200,7 @@ Total number of logical flows = 0
> >  ])
> >
> >  # create some logical flows
> > -check ovn-nbctl ls-add count-test
> > +check ovn-nbctl --wait=sb ls-add count-test
> >
> >  OVS_WAIT_UNTIL([total_lflows=`count_entries`; test $total_lflows -ne 0])
>
> I'm surprised that the above change is needed, since OVS_WAIT_UNTIL
> should wait until the condition is true.


Yes you are right. This is not needed, but I think it’s not harmful either.
Do you want me to send a v2 with this removed?

The second place is where this test occasionally fails.


>
> > @@ -219,7 +219,7 @@ $ingress_lflows
> >  ])
> >
> >  # add another datapath
> > -check ovn-nbctl ls-add count-test2
> > +check ovn-nbctl --wait=sb ls-add count-test2
> >
> >  # check total logical flows in 2 datapathes
> >  AT_CHECK_UNQUOTED([ovn-sbctl count-flows | grep "flows =" | awk
> 'NF>1{print $NF}'], [0], [dnl
>
> The one above makes sense to me.
>
>
>
Ben Pfaff July 19, 2021, 6:22 p.m. UTC | #3
On Thu, Jul 15, 2021 at 06:10:40PM -0700, Han Zhou wrote:
> On Thu, Jul 15, 2021 at 4:57 PM Ben Pfaff <blp@ovn.org> wrote:
> 
> > On Thu, Jul 15, 2021 at 04:34:51PM -0700, Han Zhou wrote:
> > > Fixes: 895e02ec0be6("ovn-sbctl.c Add logical flows count numbers")
> > > Signed-off-by: Han Zhou <hzhou@ovn.org>
> > > ---
> > >  tests/ovn-sbctl.at | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at
> > > index 16f5dabcc..dabf62d2b 100644
> > > --- a/tests/ovn-sbctl.at
> > > +++ b/tests/ovn-sbctl.at
> > > @@ -200,7 +200,7 @@ Total number of logical flows = 0
> > >  ])
> > >
> > >  # create some logical flows
> > > -check ovn-nbctl ls-add count-test
> > > +check ovn-nbctl --wait=sb ls-add count-test
> > >
> > >  OVS_WAIT_UNTIL([total_lflows=`count_entries`; test $total_lflows -ne 0])
> >
> > I'm surprised that the above change is needed, since OVS_WAIT_UNTIL
> > should wait until the condition is true.
> 
> 
> Yes you are right. This is not needed, but I think it’s not harmful either.
> Do you want me to send a v2 with this removed?

I don't think you need to send a v2, but I'd prefer to not check in that
part of the change.

> The second place is where this test occasionally fails.

That one makes sense!  For that part:
Acked-by: Ben Pfaff <blp@ovn.org>
Han Zhou July 20, 2021, 6:21 a.m. UTC | #4
On Mon, Jul 19, 2021 at 11:22 AM Ben Pfaff <blp@ovn.org> wrote:
>
> On Thu, Jul 15, 2021 at 06:10:40PM -0700, Han Zhou wrote:
> > On Thu, Jul 15, 2021 at 4:57 PM Ben Pfaff <blp@ovn.org> wrote:
> >
> > > On Thu, Jul 15, 2021 at 04:34:51PM -0700, Han Zhou wrote:
> > > > Fixes: 895e02ec0be6("ovn-sbctl.c Add logical flows count numbers")
> > > > Signed-off-by: Han Zhou <hzhou@ovn.org>
> > > > ---
> > > >  tests/ovn-sbctl.at | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at
> > > > index 16f5dabcc..dabf62d2b 100644
> > > > --- a/tests/ovn-sbctl.at
> > > > +++ b/tests/ovn-sbctl.at
> > > > @@ -200,7 +200,7 @@ Total number of logical flows = 0
> > > >  ])
> > > >
> > > >  # create some logical flows
> > > > -check ovn-nbctl ls-add count-test
> > > > +check ovn-nbctl --wait=sb ls-add count-test
> > > >
> > > >  OVS_WAIT_UNTIL([total_lflows=`count_entries`; test $total_lflows
-ne 0])
> > >
> > > I'm surprised that the above change is needed, since OVS_WAIT_UNTIL
> > > should wait until the condition is true.
> >
> >
> > Yes you are right. This is not needed, but I think it’s not harmful
either.
> > Do you want me to send a v2 with this removed?
>
> I don't think you need to send a v2, but I'd prefer to not check in that
> part of the change.
>
> > The second place is where this test occasionally fails.
>
> That one makes sense!  For that part:
> Acked-by: Ben Pfaff <blp@ovn.org>
>

Thanks Ben. I applied with the first change removed.
diff mbox series

Patch

diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at
index 16f5dabcc..dabf62d2b 100644
--- a/tests/ovn-sbctl.at
+++ b/tests/ovn-sbctl.at
@@ -200,7 +200,7 @@  Total number of logical flows = 0
 ])
 
 # create some logical flows
-check ovn-nbctl ls-add count-test
+check ovn-nbctl --wait=sb ls-add count-test
 
 OVS_WAIT_UNTIL([total_lflows=`count_entries`; test $total_lflows -ne 0])
 
@@ -219,7 +219,7 @@  $ingress_lflows
 ])
 
 # add another datapath
-check ovn-nbctl ls-add count-test2
+check ovn-nbctl --wait=sb ls-add count-test2
 
 # check total logical flows in 2 datapathes
 AT_CHECK_UNQUOTED([ovn-sbctl count-flows | grep "flows =" | awk 'NF>1{print $NF}'], [0], [dnl