You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/05/09 02:52:35 UTC

[GitHub] diecui1202 commented on issue #1756: AbstractClusterInvokerTest throws OutOfMemoryError

diecui1202 commented on issue #1756: AbstractClusterInvokerTest throws OutOfMemoryError
URL: https://github.com/apache/incubator-dubbo/issues/1756#issuecomment-387604169
 
 
   The failed testcase is: 
   
   ```java
       @Test
       public void testSelect_multiInvokers() throws Exception {
           testSelect_multiInvokers(RoundRobinLoadBalance.NAME);
           testSelect_multiInvokers(LeastActiveLoadBalance.NAME);
           testSelect_multiInvokers(RandomLoadBalance.NAME);
       }
   
       public void testSelect_multiInvokers(String lbname) throws Exception {
           int min = 1000, max = 5000;
           Double d = (Math.random() * (max - min + 1) + min);
           int runs = d.intValue();
           Assert.assertTrue(runs > min);
           LoadBalance lb = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(lbname);
           initlistsize5();
           for (int i = 0; i < runs; i++) {
               Invoker sinvoker = cluster.select(lb, invocation, invokers, selectedInvokers);
               Assert.assertEquals(true, sinvoker.isAvailable());
           }
           for (int i = 0; i < runs; i++) {
               selectedInvokers.clear();
               selectedInvokers.add(invoker1);
               Invoker sinvoker = cluster.select(lb, invocation, invokers, selectedInvokers);
               Assert.assertEquals(true, sinvoker.isAvailable());
           }
           for (int i = 0; i < runs; i++) {
               selectedInvokers.clear();
               selectedInvokers.add(invoker2);
               Invoker sinvoker = cluster.select(lb, invocation, invokers, selectedInvokers);
               Assert.assertEquals(true, sinvoker.isAvailable());
   
               Mockito.clearInvocations(invoker1, invoker2, invoker3, invoker4, invoker5);
           }
           for (int i = 0; i < runs; i++) {
               selectedInvokers.clear();
               selectedInvokers.add(invoker2);
               selectedInvokers.add(invoker4);
               Invoker sinvoker = cluster.select(lb, invocation, invokers, selectedInvokers);
               Assert.assertEquals(true, sinvoker.isAvailable());
           }
           for (int i = 0; i < runs; i++) {
               selectedInvokers.clear();
               selectedInvokers.add(invoker1);
               selectedInvokers.add(invoker3);
               selectedInvokers.add(invoker5);
               Invoker sinvoker = cluster.select(lb, invocation, invokers, selectedInvokers);
               Assert.assertEquals(true, sinvoker.isAvailable());
           }
           for (int i = 0; i < runs; i++) {
               selectedInvokers.clear();
               selectedInvokers.add(invoker1);
               selectedInvokers.add(invoker2);
               selectedInvokers.add(invoker3);
               Invoker sinvoker = cluster.select(lb, invocation, invokers, selectedInvokers);
               Assert.assertEquals(true, sinvoker.isAvailable());
           }
       }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org