Fix intermittent ConfigPersisterTest failure
authorTom Pantelis <tpanteli@brocade.com>
Fri, 15 May 2015 17:21:13 +0000 (13:21 -0400)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 27 May 2015 02:43:00 +0000 (02:43 +0000)
commit5b837b749e1dcd4f018f0b9c014ae7fab89c564f
tree16aee1baaee29245541dc33615138c1c08ce91da
parenta0a10f2fb2813a8291b45e2abe9e1b79982fbced
Fix intermittent ConfigPersisterTest failure

testSuccessConflictingVersionException fails intermittently on Jenkins
with different errors. I think the problem is that it sets up the
"workingService" which the ConfigPusher is accessing createService on
another thread. In reading Mockito FAQs, you may get strange intermittent
results with multi-threading wrt to stubbing. Mocks can be accessed from
multiple threads but it's recommended that you setup all the stubbed
methods ahead of time. So I changed
testSuccessConflictingVersionException to do so.

After the fix, I ran the ConfigPersisterTest 550 times w/o failure.

Change-Id: Ia22936cfad82416e317935bd40b0eb3ccbdb232c
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit e60d699bfe040f3ce570b4e634b0612eadeaca45)
opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterTest.java