The test case set iface-ids in OVS before-hand, and later when creating LSPs, after ovn-northd creates port-binding, the NB Logical_Switch_Port.up update and the SB Port_Binding.chassis update (by ovn-controller) happens in parallel, and occasionally the SB Port_Binding.chassis update notification arrives before NB's transaction completes, which triggers recompute. This occasional behavior is expected in the current version of I-P (improvement TBD), but it leads to instability of the test case. So, change the test case to set OVS exernal_ids:iface-id after NB LSP creation is completed, to avoid the race.
Reported-by: Dumitru Ceara <[email protected]> Signed-off-by: Han Zhou <[email protected]> --- v1 -> v2: wait ports up and sync after each port binding, to avoid race. tests/ovn-northd.at | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index 9f2f15abca8f..92c5a7b7e656 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -9493,19 +9493,22 @@ sim_add hv1 as hv1 ovs-vsctl add-br br-phys ovn_attach n1 br-phys 192.168.0.11 -ovs-vsctl add-port br-int lsp0-0 -- set interface lsp0-0 external_ids:iface-id=lsp0-0 -ovs-vsctl add-port br-int lsp0-1 -- set interface lsp0-1 external_ids:iface-id=lsp0-1 -ovs-vsctl add-port br-int lsp0-2 -- set interface lsp0-2 external_ids:iface-id=lsp0-2 check ovn-nbctl --wait=hv ls-add ls0 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 +wait_for_ports_up +check ovn-nbctl --wait=hv sync OVS_WAIT_UNTIL([test `as northd ovn-appctl -t NORTHD_TYPE inc-engine/show-stats northd recompute` = 5]) OVS_WAIT_UNTIL([test `as northd ovn-appctl -t NORTHD_TYPE inc-engine/show-stats lflow recompute` = 5]) check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats check ovn-nbctl --wait=hv lsp-add ls0 lsp0-1 -- lsp-set-addresses lsp0-1 "aa:aa:aa:00:00:01 192.168.0.11" +ovs-vsctl add-port br-int lsp0-1 -- set interface lsp0-1 external_ids:iface-id=lsp0-1 +wait_for_ports_up +check ovn-nbctl --wait=hv sync AT_CHECK([as northd ovn-appctl -t NORTHD_TYPE inc-engine/show-stats northd recompute], [0], [0 ]) AT_CHECK([as northd ovn-appctl -t NORTHD_TYPE inc-engine/show-stats lflow recompute], [0], [0 @@ -9513,6 +9516,9 @@ AT_CHECK([as northd ovn-appctl -t NORTHD_TYPE inc-engine/show-stats lflow recomp check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats check ovn-nbctl --wait=hv lsp-add ls0 lsp0-2 -- lsp-set-addresses lsp0-2 "aa:aa:aa:00:00:02 192.168.0.12" +ovs-vsctl add-port br-int lsp0-2 -- set interface lsp0-2 external_ids:iface-id=lsp0-2 +wait_for_ports_up +check ovn-nbctl --wait=hv sync AT_CHECK([as northd ovn-appctl -t NORTHD_TYPE inc-engine/show-stats northd recompute], [0], [0 ]) AT_CHECK([as northd ovn-appctl -t NORTHD_TYPE inc-engine/show-stats lflow recompute], [0], [0 -- 2.30.2 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
