Skip to content

Commit f22cc26

Browse files
committed
clear test env after OtelSdkConfigsTest
1 parent 55f32b9 commit f22cc26

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

config/src/test/java/com/megaease/easeagent/config/OtelSdkConfigsTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package com.megaease.easeagent.config;
1919

2020
import com.megaease.easeagent.plugin.utils.SystemEnv;
21+
import org.junit.After;
2122
import org.junit.Assert;
2223
import org.junit.Test;
2324

@@ -26,6 +27,15 @@
2627

2728
public class OtelSdkConfigsTest {
2829

30+
@After
31+
public void after() {
32+
SystemEnv.set("OTEL_RESOURCE_ATTRIBUTES", null);
33+
SystemEnv.set("OTEL_SERVICE_NAME", null);
34+
SystemEnv.set("OTEL_SERVICE_NAMESPACE", null);
35+
System.clearProperty("otel.service.name");
36+
System.clearProperty("otel.service.namespace");
37+
}
38+
2939
@Test
3040
public void updateEnvCfg() {
3141
//value from system env "OTEL_RESOURCE_ATTRIBUTES

0 commit comments

Comments
 (0)