11package datadog.smoketest
22
3+ import com.google.common.collect.ImmutableSet
34import datadog.trace.agent.test.utils.PortUtils
45import java.nio.file.Files
56import java.nio.file.Paths
@@ -15,6 +16,7 @@ abstract class ProcessManager extends Specification {
1516 public static final String SERVICE_NAME = " smoke-test-java-app"
1617 public static final String ENV = " smoketest"
1718 public static final String VERSION = " 99"
19+ public static final Set<String > NOISY_ENVIRONMENT_VARIABLES = ImmutableSet . of(' CI_COMMIT_MESSAGE' )
1820
1921 @Shared
2022 protected String buildDirectory = System . getProperty(" datadog.smoketest.builddir" )
@@ -77,8 +79,10 @@ abstract class ProcessManager extends Specification {
7779 (0 .. < numberOfProcesses). each { idx ->
7880 ProcessBuilder processBuilder = createProcessBuilder(idx)
7981
80- processBuilder. environment(). put(" JAVA_HOME" , System . getProperty(" java.home" ))
81- processBuilder. environment(). put(" DD_API_KEY" , apiKey())
82+ Map<String , String > env = processBuilder. environment()
83+ env. put(" JAVA_HOME" , System . getProperty(" java.home" ))
84+ env. put(" DD_API_KEY" , apiKey())
85+ muteNoisyEnvironmentVariables(env)
8286
8387 processBuilder. redirectErrorStream(true )
8488
@@ -191,6 +195,14 @@ abstract class ProcessManager extends Specification {
191195 || line. contains(" Failed to handle exception in instrumentation" )
192196 }
193197
198+ /**
199+ * Some variable can be printed in smoke application logs and result into false-positive test result.
200+ * @param env environment variables to process.
201+ */
202+ void muteNoisyEnvironmentVariables (Map<String , String > env ) {
203+ env. keySet(). removeAll(NOISY_ENVIRONMENT_VARIABLES )
204+ }
205+
194206 /**
195207 * Asserts that there are no errors printed by the application to the log.
196208 * This should usually be called after the process exits, otherwise it's not guaranteed that reading the log file will
0 commit comments