diff mbox series

[ovs-dev] ovn-northd.at: Fix occasional LSP I-P test failure due to initializtion phase.

Message ID 20230707062938.761299-1-hzhou@ovn.org
State Accepted
Headers show
Series [ovs-dev] ovn-northd.at: Fix occasional LSP I-P test failure due to initializtion phase. | 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 success github build: passed

Commit Message

Han Zhou July 7, 2023, 6:29 a.m. UTC
After the commit 0c1bde1c4a the recompute counters are more predictable,
so we changed the LSP incremental processing test to not tolerate any
failures (instead of 50% successful rate). But the test would then fail
occasionally at the first check, because sometimes the update of the
initial configurations from ovn-controller such as for tunnel interface
creation come too late, after we cleaned the stats counters and start
the LSP tests.

This patch fixes it by creating a pilot port and wait for it to be up,
so that we know the initial ovn-controller configurations are done, and
will not interfere with our I-P tests.

Fixes: 0c1bde1c4a47 ("ovn-northd: Avoid recompute caused by in-flight transactions.")
Signed-off-by: Han Zhou <hzhou@ovn.org>
---
 tests/ovn-northd.at | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Ales Musil July 7, 2023, 12:30 p.m. UTC | #1
On Fri, Jul 7, 2023 at 8:30 AM Han Zhou <hzhou@ovn.org> wrote:

> After the commit 0c1bde1c4a the recompute counters are more predictable,
> so we changed the LSP incremental processing test to not tolerate any
> failures (instead of 50% successful rate). But the test would then fail
> occasionally at the first check, because sometimes the update of the
> initial configurations from ovn-controller such as for tunnel interface
> creation come too late, after we cleaned the stats counters and start
> the LSP tests.
>
> This patch fixes it by creating a pilot port and wait for it to be up,
> so that we know the initial ovn-controller configurations are done, and
> will not interfere with our I-P tests.
>
> Fixes: 0c1bde1c4a47 ("ovn-northd: Avoid recompute caused by in-flight
> transactions.")
> Signed-off-by: Han Zhou <hzhou@ovn.org>
> ---
>  tests/ovn-northd.at | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
> index e79d33b2aec5..3e06f14c9437 100644
> --- a/tests/ovn-northd.at
> +++ b/tests/ovn-northd.at
> @@ -9532,6 +9532,13 @@ check_recompute_counter() {
>
>  check ovn-nbctl --wait=hv ls-add ls0
>
> +# Create a pilot port and wait it up to make sure we are ready for the
> real
> +# tests, so that the counters measured are accurate.
> +check ovn-nbctl --wait=hv lsp-add ls0 lsp-pilot -- lsp-set-addresses
> lsp-pilot "unknown"
> +ovs-vsctl add-port br-int lsp-pilot -- set interface lsp-pilot
> external_ids:iface-id=lsp-pilot
> +wait_for_ports_up
> +check ovn-nbctl --wait=hv sync
> +
>  check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats
>  check ovn-nbctl --wait=hv lsp-add ls0 lsp0-0 -- lsp-set-addresses lsp0-0
> "unknown"
>  ovs-vsctl add-port br-int lsp0-0 -- set interface lsp0-0
> external_ids:iface-id=lsp0-0
> --
> 2.31.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
Looks good to me, thanks.

Acked-by: Ales Musil <amusil@redhat.com>
Han Zhou July 8, 2023, 1:56 a.m. UTC | #2
On Fri, Jul 7, 2023 at 8:31 PM Ales Musil <amusil@redhat.com> wrote:
>
>
>
> On Fri, Jul 7, 2023 at 8:30 AM Han Zhou <hzhou@ovn.org> wrote:
>>
>> After the commit 0c1bde1c4a the recompute counters are more predictable,
>> so we changed the LSP incremental processing test to not tolerate any
>> failures (instead of 50% successful rate). But the test would then fail
>> occasionally at the first check, because sometimes the update of the
>> initial configurations from ovn-controller such as for tunnel interface
>> creation come too late, after we cleaned the stats counters and start
>> the LSP tests.
>>
>> This patch fixes it by creating a pilot port and wait for it to be up,
>> so that we know the initial ovn-controller configurations are done, and
>> will not interfere with our I-P tests.
>>
>> Fixes: 0c1bde1c4a47 ("ovn-northd: Avoid recompute caused by in-flight
transactions.")
>> Signed-off-by: Han Zhou <hzhou@ovn.org>
>> ---
>>  tests/ovn-northd.at | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
>> index e79d33b2aec5..3e06f14c9437 100644
>> --- a/tests/ovn-northd.at
>> +++ b/tests/ovn-northd.at
>> @@ -9532,6 +9532,13 @@ check_recompute_counter() {
>>
>>  check ovn-nbctl --wait=hv ls-add ls0
>>
>> +# Create a pilot port and wait it up to make sure we are ready for the
real
>> +# tests, so that the counters measured are accurate.
>> +check ovn-nbctl --wait=hv lsp-add ls0 lsp-pilot -- lsp-set-addresses
lsp-pilot "unknown"
>> +ovs-vsctl add-port br-int lsp-pilot -- set interface lsp-pilot
external_ids:iface-id=lsp-pilot
>> +wait_for_ports_up
>> +check ovn-nbctl --wait=hv sync
>> +
>>  check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats
>>  check ovn-nbctl --wait=hv lsp-add ls0 lsp0-0 -- lsp-set-addresses
lsp0-0 "unknown"
>>  ovs-vsctl add-port br-int lsp0-0 -- set interface lsp0-0
external_ids:iface-id=lsp0-0
>> --
>> 2.31.1
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>
>
> Looks good to me, thanks.
>
> Acked-by: Ales Musil <amusil@redhat.com>
>

Thanks Ales. I applied to main.

Han

> --
>
> Ales Musil
>
> Senior Software Engineer - OVN Core
>
> Red Hat EMEA
>
> amusil@redhat.com    IM: amusil
diff mbox series

Patch

diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index e79d33b2aec5..3e06f14c9437 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -9532,6 +9532,13 @@  check_recompute_counter() {
 
 check ovn-nbctl --wait=hv ls-add ls0
 
+# Create a pilot port and wait it up to make sure we are ready for the real
+# tests, so that the counters measured are accurate.
+check ovn-nbctl --wait=hv lsp-add ls0 lsp-pilot -- lsp-set-addresses lsp-pilot "unknown"
+ovs-vsctl add-port br-int lsp-pilot -- set interface lsp-pilot external_ids:iface-id=lsp-pilot
+wait_for_ports_up
+check ovn-nbctl --wait=hv sync
+
 check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats
 check ovn-nbctl --wait=hv lsp-add ls0 lsp0-0 -- lsp-set-addresses lsp0-0 "unknown"
 ovs-vsctl add-port br-int lsp0-0 -- set interface lsp0-0 external_ids:iface-id=lsp0-0