Skip to content

Commit 40edb59

Browse files
Disable retry instrumentations if both Early Flakiness Detection and Flaky Test Retries are turned off (#6925)
1 parent 34e7066 commit 40edb59

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ModuleExecutionSettingsFactoryImpl.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public ModuleExecutionSettings create(JvmInfo jvmInfo, @Nullable String moduleNa
6666
boolean earlyFlakeDetectionEnabled = isEarlyFlakeDetectionEnabled(ciVisibilitySettings);
6767
Map<String, String> systemProperties =
6868
getPropertiesPropagatedToChildProcess(
69-
codeCoverageEnabled, itrEnabled, flakyTestRetriesEnabled);
69+
codeCoverageEnabled, itrEnabled, flakyTestRetriesEnabled, earlyFlakeDetectionEnabled);
7070

7171
LOGGER.info(
7272
"CI Visibility settings ({}, {}):\n"
@@ -196,7 +196,10 @@ private boolean isEarlyFlakeDetectionEnabled(CiVisibilitySettings ciVisibilitySe
196196
}
197197

198198
private Map<String, String> getPropertiesPropagatedToChildProcess(
199-
boolean codeCoverageEnabled, boolean itrEnabled, boolean flakyTestRetriesEnabled) {
199+
boolean codeCoverageEnabled,
200+
boolean itrEnabled,
201+
boolean flakyTestRetriesEnabled,
202+
boolean earlyFlakeDetectionEnabled) {
200203
Map<String, String> propagatedSystemProperties = new HashMap<>();
201204
Properties systemProperties = System.getProperties();
202205
for (Map.Entry<Object, Object> e : systemProperties.entrySet()) {
@@ -223,6 +226,11 @@ private Map<String, String> getPropertiesPropagatedToChildProcess(
223226
CiVisibilityConfig.CIVISIBILITY_FLAKY_RETRY_ENABLED),
224227
Boolean.toString(flakyTestRetriesEnabled));
225228

229+
propagatedSystemProperties.put(
230+
Strings.propertyNameToSystemPropertyName(
231+
CiVisibilityConfig.CIVISIBILITY_EARLY_FLAKE_DETECTION_ENABLED),
232+
Boolean.toString(earlyFlakeDetectionEnabled));
233+
226234
// explicitly disable build instrumentation in child processes,
227235
// because some projects run "embedded" Maven/Gradle builds as part of their integration tests,
228236
// and we don't want to show those as if they were regular build executions

0 commit comments

Comments
 (0)