You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/02/24 13:24:03 UTC

[GitHub] [incubator-inlong] wardlican commented on a change in pull request #2685: [INLONG-2684][Sort] Fix OOM for sort sdk unit test

wardlican commented on a change in pull request #2685:
URL: https://github.com/apache/incubator-inlong/pull/2685#discussion_r813874430



##########
File path: inlong-sdk/sort-sdk/src/test/java/org/apache/inlong/sdk/sort/impl/InLongPulsarFetcherImplTest.java
##########
@@ -42,42 +43,51 @@
 import org.junit.runner.RunWith;
 import org.powermock.api.mockito.PowerMockito;
 import org.powermock.core.classloader.annotations.PowerMockIgnore;
+import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 import org.powermock.reflect.Whitebox;
 
 @PowerMockIgnore("javax.management.*")
 @RunWith(PowerMockRunner.class)
+@PrepareForTest({ClientContext.class})
 public class InLongPulsarFetcherImplTest {
 
     private ClientContext clientContext;
-    private SortClientConfig sortClientConfig;
     private InLongTopic inLongTopic;
+    private SortClientConfig sortClientConfig;
     private StatManager statManager;
-    private SortClientStateCounter sortClientStateCounter;
 
     /**
      * setUp
      */
     @Before
     public void setUp() throws Exception {
+        System.setProperty("log4j2.disable.jmx", Boolean.TRUE.toString());
+
         inLongTopic = new InLongTopic();
         inLongTopic.setTopic("testTopic");
         inLongTopic.setPartitionId(0);
         inLongTopic.setTopicType("pulsar");
 
         CacheZoneCluster cacheZoneCluster = new CacheZoneCluster("clusterId", "bootstraps", "token");
         inLongTopic.setInLongCluster(cacheZoneCluster);
-        clientContext = PowerMockito.mock(ClientContext.class);
+        try {
+            clientContext = PowerMockito.mock(ClientContext.class);
+        } catch (Exception e) {
+            e.printStackTrace();

Review comment:
       ok I will fix it in next version




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org