zentol commented on a change in pull request #15279:
URL: https://github.com/apache/flink/pull/15279#discussion_r597646441



##########
File path: 
flink-core/src/test/java/org/apache/flink/testutils/ThrowOnDoubleMemoryFreeing.java
##########
@@ -19,32 +19,28 @@
 package org.apache.flink.testutils;
 
 import org.apache.flink.core.memory.MemorySegment;
-import org.apache.flink.core.testutils.CommonTestUtils;
 import org.apache.flink.util.ExternalResource;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.Properties;
 
 /**
  * A rule that can be used to enable throwing exception on multiple freeing of 
{@link
  * MemorySegment}.
  */
 public class ThrowOnDoubleMemoryFreeing implements ExternalResource {
 
-    private Map<String, String> systemEnv = new HashMap<>();
+    private Properties systemProperties;
 
     @Override
     public void before() throws Exception {
-        systemEnv = System.getenv();
-        CommonTestUtils.setEnv(
-                
Collections.singletonMap(MemorySegment.CHECK_MULTIPLE_FREE_PROPERTY, ""), 
false);
+        systemProperties = System.getProperties();
+        System.setProperty(MemorySegment.CHECK_MULTIPLE_FREE_PROPERTY, "");

Review comment:
       But the `MemorySegment` class could already have been loaded by another 
test class?
   
   I don't think unit tests have isolated class-loaders.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to