From 64c41c6936f876dff019c8d7bf55454d91f8a1f7 Mon Sep 17 00:00:00 2001 From: Yuhao Bi Date: Thu, 29 Nov 2018 00:41:10 +0800 Subject: [PATCH] [Dubbo-2845] Fix OOM in UT testSelectByWeight (#2845) --- .../rpc/cluster/loadbalance/LoadBalanceBaseTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/LoadBalanceBaseTest.java b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/LoadBalanceBaseTest.java index 58cd86d0447..f2af3d39dff 100644 --- a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/LoadBalanceBaseTest.java +++ b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/LoadBalanceBaseTest.java @@ -30,6 +30,7 @@ import org.junit.Test; import com.alibaba.fastjson.JSON; +import org.mockito.Mockito; import java.util.ArrayList; import java.util.List; @@ -209,10 +210,10 @@ public String toString() { @Before public void before() throws Exception { - weightInvoker1 = mock(Invoker.class); - weightInvoker2 = mock(Invoker.class); - weightInvoker3 = mock(Invoker.class); - weightInvokerTmp = mock(Invoker.class); + weightInvoker1 = mock(Invoker.class, Mockito.withSettings().stubOnly()); + weightInvoker2 = mock(Invoker.class, Mockito.withSettings().stubOnly()); + weightInvoker3 = mock(Invoker.class, Mockito.withSettings().stubOnly()); + weightInvokerTmp = mock(Invoker.class, Mockito.withSettings().stubOnly()); weightTestInvocation = new RpcInvocation(); weightTestInvocation.setMethodName("test");