Bug 2415: Fixed intermittent RpcRegistry unit test failures 37/13937/1
authortpantelis <tpanteli@brocade.com>
Wed, 19 Nov 2014 13:30:20 +0000 (08:30 -0500)
committertpantelis <tpanteli@brocade.com>
Tue, 6 Jan 2015 05:11:17 +0000 (00:11 -0500)
commitc5025e305a7a59920cd65ea8ea2d1010b433135d
tree27b0f7cd088cb27d6acc7b5a15a3de4315117ed7
parent22538f60cce2e4e5fb34cda15c7b6eaa0fb9d826
Bug 2415: Fixed intermittent RpcRegistry unit test failures

The tests inject a ConditionalProbe into the BucketStore actor via a
message so it can verify the BuckStore received expected messages from
the RpcRegistry actor. The problem was that the BucketStore actor may
not have been created yet, as this is done async by akka, by the time
the test sends the ConditionalProbe message, in which case the message
went to dead letters resulting in a test failure.

To fix it, I modified the BucketStore to return a response on receiving
the ConditionalProbe so the tests can know deterministically that it
received it. I did this in a retry loop in the tests as I still saw
sporadic failures if just trying once.

After the fix, the RpcRegistry tests ran 900 times successfully.

Change-Id: I7094954c4a38493cc910723a5a6950c073e2f03a
Signed-off-by: tpantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/BucketStore.java
opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java