Skip to content

Commit 3bf7618

Browse files
committed
Fix flakiness in remoteep test: egDomain updates and remoteEpInv updates are both handled by remoteEndpointUpdated(). The number of these calls can be > 3. So wait for the updates to settle down, before we clear and start next tests.
Signed-off-by: Gautam Venkataramanan <gautam.chennai@gmail.com> Change-Id: I764bf1336af2bce9cef083be603b814ec3d2e7d7
1 parent 3959806 commit 3bf7618

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

agent-ovs/lib/test/EndpointManager_test.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,7 @@ class MockEndpointListener : public EndpointListener {
797797
virtual void remoteEndpointUpdated(const std::string& uuid) {
798798
std::unique_lock<std::mutex> guard(mutex);
799799
updates.insert(uuid);
800+
LOG(DEBUG) << "updated uuid: " << uuid << ", total#" << updates.size();
800801
};
801802

802803
size_t numUpdates() {
@@ -844,8 +845,10 @@ BOOST_FIXTURE_TEST_CASE( remoteEndpoint, BaseFixture ) {
844845
WAIT_FOR(agent.getPolicyManager().groupExists(epg0->getURI()), 500);
845846
WAIT_FOR(agent.getPolicyManager().groupExists(epg1->getURI()), 500);
846847
WAIT_FOR(listener.numUpdates() == 3, 500);
847-
listener.clear();
848848

849+
// Wait for egDomain and remoteEp updates to settle down
850+
usleep(100000);
851+
listener.clear();
849852
// update epg for ep
850853
rep1->addInvRemoteInventoryEpToGroupRSrc()
851854
->setTargetEpGroup(epg1->getURI());

0 commit comments

Comments
 (0)