Skip to content

Commit

Permalink
Remove invalid test in XmppStateMachineTest
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ananth-at-camphor-networks committed Mar 26, 2018
1 parent ce68af5 commit 1a9d645
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/xmpp/test/xmpp_server_sm_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,30 +383,6 @@ TEST_F(XmppStateMachineTest, Established_EvTcpClose) {
VerifyState(xmsm::IDLE);
}

// 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
Expand Down

0 comments on commit 1a9d645

Please sign in to comment.