[JBoss JIRA] (ISPN-3671) Evaluate replacement of Mockito usage of spy with Forwarding mocks instead
by William Burns (JIRA)
William Burns created ISPN-3671:
-----------------------------------
Summary: Evaluate replacement of Mockito usage of spy with Forwarding mocks instead
Key: ISPN-3671
URL: https://issues.jboss.org/browse/ISPN-3671
Project: Infinispan
Issue Type: Bug
Components: Test Suite
Affects Versions: 6.0.0.CR1
Reporter: William Burns
Assignee: Mircea Markus
Usage of Mockito spy actually creates a new instance (with current state) of the provided delegate. This can cause issues if there are already threads created that modify the provided delegate state as it won't affect the new object.
It would be safer to first use a forwarding mock instead that doesn't create another instance as this has caused issues with some tests regarding state transfer.
Here is an example of how the forwarding mock can be used.
{code}
StateConsumer sc = TestingUtil.extractComponent(cache, StateConsumer.class);
final Answer<Object> forwardedAnswer = AdditionalAnswers.delegatesTo(sc);
StateConsumer mockConsumer = mock(StateConsumer.class, withSettings().defaultAnswer(forwardedAnswer));
TestingUtil.replaceComponent(cache, StateConsumer.class, mockConsumer, true);
doAnswer(new Answer() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
// Do something
return forwardedAnswer.answer(invocation);
}
}).when(mockConsumer).applyState(any(Address.class), anyInt(), anyCollection());
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (ISPN-2719) Intermittent failure SyncCacheListenerTest.testRemoteCacheListener
by Martin Gencur (JIRA)
[ https://issues.jboss.org/browse/ISPN-2719?page=com.atlassian.jira.plugin.... ]
Martin Gencur updated ISPN-2719:
--------------------------------
Labels: testsuite_stability (was: )
> Intermittent failure SyncCacheListenerTest.testRemoteCacheListener
> ------------------------------------------------------------------
>
> Key: ISPN-2719
> URL: https://issues.jboss.org/browse/ISPN-2719
> Project: Infinispan
> Issue Type: Bug
> Components: Transactions
> Affects Versions: 5.2.0.CR2
> Reporter: Galder Zamarreño
> Assignee: Mircea Markus
> Labels: testsuite_stability
> Attachments: testRemoteCacheListener-5.log
>
>
> {code}testRemoteCacheListener(org.infinispan.replication.SyncCacheListenerTest) Time elapsed: 0.059 sec <<< FAILURE!
> org.infinispan.CacheException: Could not commit implicit transaction
> at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1159)
> at org.infinispan.CacheImpl.removeInternal(CacheImpl.java:310)
> at org.infinispan.CacheImpl.remove(CacheImpl.java:304)
> at org.infinispan.CacheImpl.remove(CacheImpl.java:298)
> at org.infinispan.replication.SyncCacheListenerTest.testRemoteCacheListener(SyncCacheListenerTest.java:113)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:715)
> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:907)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1237)
> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
> at org.testng.TestRunner.privateRun(TestRunner.java:767)
> at org.testng.TestRunner.run(TestRunner.java:617)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
> at org.testng.SuiteRunner.access$000(SuiteRunner.java:37)
> at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:368)
> at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:680)
> Caused by: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
> at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)
> at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
> at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1156)
> ... 25 more{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (ISPN-3304) ClusterTopologyManagerTest.testClusterRecoveryAfterThreeWaySplit fails randomly
by Martin Gencur (JIRA)
[ https://issues.jboss.org/browse/ISPN-3304?page=com.atlassian.jira.plugin.... ]
Martin Gencur updated ISPN-3304:
--------------------------------
Labels: testsuite_stability (was: )
> ClusterTopologyManagerTest.testClusterRecoveryAfterThreeWaySplit fails randomly
> -------------------------------------------------------------------------------
>
> Key: ISPN-3304
> URL: https://issues.jboss.org/browse/ISPN-3304
> Project: Infinispan
> Issue Type: Bug
> Affects Versions: 5.3.0.Final
> Reporter: Pedro Ruivo
> Assignee: Mircea Markus
> Labels: testsuite_stability
> Attachments: ClusterTopologyManagerTest.testClusterRecoveryAfterThreeWaySplit.tar.gz
>
>
> {code:java}
> java.lang.RuntimeException: Timed out before caches had complete views. Expected 3 members in each view. Views are as follows: [[ClusterTopologyManagerTest-NodeL-25341], [ClusterTopologyManagerTest-NodeN-52944, ClusterTopologyManagerTest-NodeM-9914], [ClusterTopologyManagerTest-NodeN-52944, ClusterTopologyManagerTest-NodeM-9914]]
> at org.infinispan.test.TestingUtil.viewsTimedOut(TestingUtil.java:232)
> at org.infinispan.test.TestingUtil.viewsTimedOut(TestingUtil.java:222)
> at org.infinispan.test.TestingUtil.blockUntilViewsReceived(TestingUtil.java:214)
> at org.infinispan.test.TestingUtil.blockUntilViewsReceived(TestingUtil.java:255)
> at org.infinispan.statetransfer.ClusterTopologyManagerTest.testClusterRecoveryAfterThreeWaySplit(ClusterTopologyManagerTest.java:156)
> ...
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (ISPN-3306) RehashWithSharedCacheStoreTest.testRehashes fails randomly
by Martin Gencur (JIRA)
[ https://issues.jboss.org/browse/ISPN-3306?page=com.atlassian.jira.plugin.... ]
Martin Gencur updated ISPN-3306:
--------------------------------
Labels: testsuite_stability (was: )
> RehashWithSharedCacheStoreTest.testRehashes fails randomly
> ----------------------------------------------------------
>
> Key: ISPN-3306
> URL: https://issues.jboss.org/browse/ISPN-3306
> Project: Infinispan
> Issue Type: Bug
> Affects Versions: 5.3.0.Final
> Reporter: Pedro Ruivo
> Assignee: Mircea Markus
> Labels: testsuite_stability
> Attachments: RehashWithSharedCacheStoreTest.testRehashes.tar.gz
>
>
> {code:java}
> java.lang.RuntimeException: Timed out waiting for rebalancing to complete on node RehashWithSharedCacheStoreTest-NodeB-2392, current topology is CacheTopology{id=8, currentCH=DefaultConsistentHash{numSegments=60, numOwners=2, members=[RehashWithSharedCacheStoreTest-NodeB-2392, RehashWithSharedCacheStoreTest-NodeC-18606]}, pendingCH=DefaultConsistentHash{numSegments=60, numOwners=2, members=[RehashWithSharedCacheStoreTest-NodeB-2392, RehashWithSharedCacheStoreTest-NodeC-18606]}}
> at org.infinispan.test.TestingUtil.waitForRehashToComplete(TestingUtil.java:181)
> at org.infinispan.test.TestingUtil.waitForRehashToComplete(TestingUtil.java:191)
> at org.infinispan.distribution.rehash.RehashWithSharedCacheStoreTest.testRehashes(RehashWithSharedCacheStoreTest.java:76)
> ...
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (ISPN-3670) Any commands received before the initial topology is installed should block
by Dan Berindei (JIRA)
Dan Berindei created ISPN-3670:
----------------------------------
Summary: Any commands received before the initial topology is installed should block
Key: ISPN-3670
URL: https://issues.jboss.org/browse/ISPN-3670
Project: Infinispan
Issue Type: Bug
Components: State transfer
Affects Versions: 6.0.0.CR1
Reporter: Dan Berindei
Assignee: Dan Berindei
Priority: Critical
Fix For: 6.0.0.CR2
Because the initial cache topology is installed in a single phase, it's possible to receive a StateRequestCommand from another node before receiving the JOIN response from the coordinator and installing the initial cache topology. As such, commands received before we have a cache topology should block instead of being ignored.
This bug is especially visible in the Map/Reduce tests (e.g. ReplicatedTwoNodesMapReduceTest) because the M/R task sends the CreateCacheCommand to the other nodes before it's executed on the originator. Since the originator happens to be the coordinator, it's possible for the coordinator to start the rebalance before the first member installed the initial topology.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months