xintongsong commented on a change in pull request #15279:
URL: https://github.com/apache/flink/pull/15279#discussion_r597527481
##########
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:
Currently we have `MemoryManagerTest` using this.
I think this should work fine as a class rule, but may not work as a test
rule.
This is intermediate anyway. Once we have fixed existing multiple-free
cases, we will set the property for all the CI tests, and will not need this
rule anymore.
--
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]