Skip to content

Commit

Permalink
Disable retry instrumentations if both Early Flakiness Detection and …
Browse files Browse the repository at this point in the history
…Flaky Test Retries are turned off (#6925)
  • Loading branch information
nikita-tkachenko-datadog committed Apr 17, 2024
1 parent 34e7066 commit 40edb59
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public ModuleExecutionSettings create(JvmInfo jvmInfo, @Nullable String moduleNa
boolean earlyFlakeDetectionEnabled = isEarlyFlakeDetectionEnabled(ciVisibilitySettings);
Map<String, String> systemProperties =
getPropertiesPropagatedToChildProcess(
codeCoverageEnabled, itrEnabled, flakyTestRetriesEnabled);
codeCoverageEnabled, itrEnabled, flakyTestRetriesEnabled, earlyFlakeDetectionEnabled);

LOGGER.info(
"CI Visibility settings ({}, {}):\n"
Expand Down Expand Up @@ -196,7 +196,10 @@ private boolean isEarlyFlakeDetectionEnabled(CiVisibilitySettings ciVisibilitySe
}

private Map<String, String> getPropertiesPropagatedToChildProcess(
boolean codeCoverageEnabled, boolean itrEnabled, boolean flakyTestRetriesEnabled) {
boolean codeCoverageEnabled,
boolean itrEnabled,
boolean flakyTestRetriesEnabled,
boolean earlyFlakeDetectionEnabled) {
Map<String, String> propagatedSystemProperties = new HashMap<>();
Properties systemProperties = System.getProperties();
for (Map.Entry<Object, Object> e : systemProperties.entrySet()) {
Expand All @@ -223,6 +226,11 @@ private Map<String, String> getPropertiesPropagatedToChildProcess(
CiVisibilityConfig.CIVISIBILITY_FLAKY_RETRY_ENABLED),
Boolean.toString(flakyTestRetriesEnabled));

propagatedSystemProperties.put(
Strings.propertyNameToSystemPropertyName(
CiVisibilityConfig.CIVISIBILITY_EARLY_FLAKE_DETECTION_ENABLED),
Boolean.toString(earlyFlakeDetectionEnabled));

// explicitly disable build instrumentation in child processes,
// because some projects run "embedded" Maven/Gradle builds as part of their integration tests,
// and we don't want to show those as if they were regular build executions
Expand Down

0 comments on commit 40edb59

Please sign in to comment.