Skip to content

Commit 83e7b14

Browse files
fix flink procedure test case
1 parent 1717086 commit 83e7b14

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/procedure/SetClusterConfigProcedure.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private String[] performSet(String configKey, @Nullable String configValue) thro
100100
operationDesc = String.format("set to '%s'", configValue);
101101
}
102102

103-
// Construct configuration modification operation
103+
// Construct configuration modification operation.
104104
AlterConfig alterConfig = new AlterConfig(configKey, configValue, opType);
105105

106106
// Call Admin API to modify cluster configuration

fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/procedure/FlinkProcedureITCase.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.apache.flink.types.Row;
3030
import org.apache.flink.util.CloseableIterator;
3131
import org.apache.flink.util.CollectionUtil;
32+
import org.junit.jupiter.api.AfterEach;
3233
import org.junit.jupiter.api.BeforeEach;
3334
import org.junit.jupiter.api.Test;
3435
import org.junit.jupiter.api.extension.RegisterExtension;
@@ -86,6 +87,31 @@ void before() throws ExecutionException, InterruptedException {
8687
tEnv.executeSql("use catalog " + CATALOG_NAME);
8788
}
8889

90+
@AfterEach
91+
void after() throws Exception {
92+
// Clean up any dynamic config changes made during the test
93+
// to ensure tests don't affect each other
94+
if (tEnv != null) {
95+
try {
96+
// Delete dynamic configs that might have been modified during tests
97+
// This resets them to their initial static configuration values
98+
tEnv.executeSql(
99+
String.format(
100+
"Call %s.sys.set_cluster_config('%s')",
101+
CATALOG_NAME,
102+
ConfigOptions.KV_SHARED_RATE_LIMITER_BYTES_PER_SEC.key()))
103+
.await();
104+
tEnv.executeSql(
105+
String.format(
106+
"Call %s.sys.set_cluster_config('%s')",
107+
CATALOG_NAME, ConfigOptions.DATALAKE_FORMAT.key()))
108+
.await();
109+
} catch (Exception e) {
110+
// Ignore cleanup errors to avoid masking test failures
111+
}
112+
}
113+
}
114+
89115
@Test
90116
void testShowProcedures() throws Exception {
91117
try (CloseableIterator<Row> showProceduresIterator =

0 commit comments

Comments
 (0)