Stabilize bgp_xmpp_wready unit test

Bug #1775714 reported by Ananth Suryanarayana on 2018-06-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
Fix Committed
Medium
Ananth Suryanarayana
Trunk
Fix Committed
Medium
Ananth Suryanarayana

Bug Description

Some times bgp_xmpp_wready_test unit test fails because route count check is not deterministic.
SendBlock is enabled after the first send, but it is not always guaranteed that first write has only one route. It can have data for first two routes as well (one blue and one red)

diff --git a/src/bgp/test/bgp_xmpp_wready_test.cc b/src/bgp/test/bgp_xmpp_wready_test.cc
index d23150a..9da82cf 100644
--- a/src/bgp/test/bgp_xmpp_wready_test.cc
+++ b/src/bgp/test/bgp_xmpp_wready_test.cc
@@ -277,14 +277,18 @@ TEST_F(BgpXmppUnitTest, WriteReadyTest) {
     WAIT_EQ(4, bgp_channel_manager_->channel_->Count());
     BGP_DEBUG_UT("Received route for blue at Server \n ");

+ // We may receive one or two routes depending on when the write-block
+ // takes effect.
+ TASK_UTIL_EXPECT_GE(2, agent_a_->RouteCount());
+
     agent_a_->AddRoute("red","20.1.1.1/32");
     WAIT_EQ(5, bgp_channel_manager_->channel_->Count());
     BGP_DEBUG_UT("Received route for red at Server \n ");

- // send blocked, no route should be reflected back after the first one.
- // check a few times to make sure that no more routes are reflected
+ // send blocked, no route should be reflected back after the first one
+ // or two. check a few times to make sure that no more routes are reflected.
     for (int idx = 0; idx < 10; ++idx) {
- WAIT_EQ(1, agent_a_->RouteCount());
+ TASK_UTIL_EXPECT_GE(2, agent_a_->RouteCount());
         usleep(10000);
         task_util::WaitForIdle();
     }

Review in progress for https://review.opencontrail.org/43628
Submitter: Ananth Suryanarayana (<email address hidden>)

Review in progress for https://review.opencontrail.org/43629
Submitter: Ananth Suryanarayana (<email address hidden>)

Jeba Paulaiyan (jebap) on 2018-06-07
tags: added: contrail-control

Reviewed: https://review.opencontrail.org/43628
Committed: http://github.com/Juniper/contrail-controller/commit/ad64b89d68d098554b5387a7b6acedf4f8c37e42
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit ad64b89d68d098554b5387a7b6acedf4f8c37e42
Author: Ananth Suryanarayana <email address hidden>
Date: Thu Jun 7 14:48:14 2018 -0700

Stabilize bgp_xmpp_wready unit test

Some times bgp_xmpp_wready_test unit test fails because route count
check is not deterministic. SendBlock is enabled after the first send,
but it is not always guaranteed that first write has only one route.
It can have data for first two routes as well (one blue and one red)

Change-Id: I47fe20f504b87ffd51063a0145ce598d7c0a4353
Closes-Bug: 1775714

OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/43629
Committed: http://github.com/Juniper/contrail-controller/commit/0de3ba30c6806c7d6a24569d562bad514d3885f7
Submitter: Zuul v3 CI (<email address hidden>)
Branch: R5.0

commit 0de3ba30c6806c7d6a24569d562bad514d3885f7
Author: Ananth Suryanarayana <email address hidden>
Date: Thu Jun 7 14:48:14 2018 -0700

Stabilize bgp_xmpp_wready unit test

Some times bgp_xmpp_wready_test unit test fails because route count
check is not deterministic. SendBlock is enabled after the first send,
but it is not always guaranteed that first write has only one route.
It can have data for first two routes as well (one blue and one red)

Change-Id: I47fe20f504b87ffd51063a0145ce598d7c0a4353
Closes-Bug: 1775714

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers