Bug 2415: Fixed intermittent RpcRegistry unit test failures 51/13151/1
authortpantelis <tpanteli@brocade.com>
Wed, 19 Nov 2014 13:30:20 +0000 (08:30 -0500)
committertpantelis <tpanteli@brocade.com>
Wed, 19 Nov 2014 13:30:20 +0000 (08:30 -0500)
commit98a367ef29fe31fcb4bd226dfc52b8519567f62c
treee69fd096136b73784c479bb670f58b79b1a237f1
parentdcf33df6f7666290340163a0f7c71a63430c827b
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