Fix intermittent ConfigPersisterTest failure 39/21139/2
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)
commit89c5571e29995b24e3364ab0c82a7351a3379d18
tree4f588217f11345615bddf9627abfc1981fcae71d
parentb76162c1bf82cc368dbb78cbebca3d50e30eb5b8
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