Remove invalid test XmppStateMachineTest::Established_EvTcpClose_Then_EvXmppMessageStreamHeader

Bug #1758806 reported by Ananth Suryanarayana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
High
Ananth Suryanarayana

Bug Description

diff --git a/src/xmpp/test/xmpp_server_sm_test.cc b/src/xmpp/test/xmpp_server_sm_test.cc
index 90785b6..8c9a05d 100644
--- a/src/xmpp/test/xmpp_server_sm_test.cc
+++ b/src/xmpp/test/xmpp_server_sm_test.cc
@@ -384,30 +384,6 @@ TEST_F(XmppStateMachineTest, Established_EvTcpClose) {
 }

 // Old State : Established
-// Event : EvTcpClose + EvXmppMessageStreamHeader
-// New State : Idle
-// Intent : EvXmppMessageStreamHeader should not be processed when the
-// session is no longer associated with the connection due to
-// processing of EvTcpClose
-TEST_F(XmppStateMachineTest,
- Established_EvTcpClose_Then_EvXmppMessageStreamHeader) {
- VerifyState(xmsm::ACTIVE);
-
- EvTcpPassiveOpenFake();
- VerifyState(xmsm::ACTIVE);
-
- EvXmppOpen();
-
- VerifyState(xmsm::ESTABLISHED);
-
- EvTcpClose();
- VerifyState(xmsm::IDLE);
-
- EvXmppMessageStreamHeader();
- VerifyState(xmsm::IDLE);
-}
-
-// Old State : Established
 // Event : EvStop
 // New State : Idle
 TEST_F(XmppStateMachineTest, Established_EvStop) {

In this test, EvXmppMessageStreamHeader is injected into a session_ XmppSession *, after injecting EvTcpClose event. This is an invalid scenario because as a result of processing EvTcpClose, XmppSession *session pointer can/will get destroyed. Hence, we should not enqueue EvXmppMessageStreamHeader over a deleted session. This can cause the test to crash and hence makes the test xmpp_server_sm_test potentially flaky.

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

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

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

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

commit 1a9d64504342228d5f4ce70a892343808ae9a19a
Author: Ananth Suryanarayana <email address hidden>
Date: Sun Mar 25 21:26:27 2018 -0700

Remove invalid test in XmppStateMachineTest

In the test Established_EvTcpClose_Then_EvXmppMessageStreamHeader,
EvXmppMessageStreamHeader is injected into a session_ XmppSession *, after
injecting EvTcpClose event. This is an invalid scenario because as a result of
processing EvTcpClose, XmppSession *session pointer can/will get destroyed.
Hence, we should not enqueue EvXmppMessageStreamHeader over a deleted session
later on. This can cause the test to crash and hence makes this test case in
xmpp_server_sm_test flaky.

Change-Id: I66b257c49ede25e4142d93aa0264f729b1896031
Closes-Bug: 1758806

Jeba Paulaiyan (jebap)
tags: added: contrail-control
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.