jt2594838 commented on code in PR #18467:
URL: https://github.com/apache/iotdb/pull/18467#discussion_r3840692517


##########
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/conf/IoTDBDescriptorSystemPropertiesTest.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.db.conf;
+
+import org.apache.iotdb.commons.conf.CommonConfig;
+import org.apache.iotdb.commons.conf.IoTDBConstant;
+import org.apache.iotdb.commons.memory.MemoryConfig;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+import java.io.File;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+
+import static org.junit.Assert.assertEquals;
+
+public class IoTDBDescriptorSystemPropertiesTest {
+
+  @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+  @Test
+  public void testSystemPropertiesInitializeConfiguredRpcBufferMemory() throws 
Exception {
+    String originalConf = System.getProperty(IoTDBConstant.IOTDB_CONF);
+    File confDir = temporaryFolder.newFolder();
+    Files.writeString(
+        confDir.toPath().resolve(CommonConfig.SYSTEM_CONFIG_NAME),

Review Comment:
   This test uses a real temporary system properties file so the constructor 
executes the configured-property path. It verifies the regression fix through 
the public RPC buffer memory control after the descriptor initializes memory 
from datanode_memory_proportion.



##########
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/conf/IoTDBDescriptorDefaultMemoryConfigTest.java:
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.db.conf;
+
+import org.apache.iotdb.commons.conf.IoTDBConstant;
+import org.apache.iotdb.commons.memory.MemoryConfig;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class IoTDBDescriptorDefaultMemoryConfigTest {
+
+  @Test
+  public void testNoConfigurationSourceInitializesDefaultRpcBufferMemory() {
+    String originalConf = System.getProperty(IoTDBConstant.IOTDB_CONF);

Review Comment:
   This test keeps the no-configuration fallback covered by forcing the system 
properties lookup to return no URL. The assertion verifies that the descriptor 
still installs the default maxMemory / 20 RPC buffer budget when no source 
initializes memory.



-- 
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: [email protected]

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

Reply via email to