From 5aeb049ea3e67725377b4e6ed3936c5bc1289deb Mon Sep 17 00:00:00 2001 From: Yuhao Bi Date: Thu, 29 Nov 2018 10:12:13 +0800 Subject: [PATCH] [Dubbo-2845] Fix OOM in UT testSelectByWeight (#2845) (#2846) Fix OOM Exception generated during UT --- .../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");