Skip to content

Commit 4fd99ee

Browse files
fix: update propagated error message
1 parent e7ff3d7 commit 4fd99ee

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/EarlyFlakeDetection.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ public boolean suppressFailures() {
7373

7474
@Override
7575
public boolean propagateFailure() {
76-
// used to bypass TestNG's RetryAnalyzer marking `fail` + `pass` test executions as passed
76+
// used to bypass TestNG's RetryAnalyzer, which made the framework session status depend on
77+
// result order:
78+
// pass + fail -> fail (correct)
79+
// fail + pass -> pass (incorrect)
7780
return !suppressFailures && results == ExecutionAggregation.MIXED;
7881
}
7982

dd-java-agent/instrumentation/testng/testng-7.0/src/main/java/datadog/trace/instrumentation/testng7/TestNGExecutionInstrumentation.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,11 @@ public static void modifyStatus(@Advice.Argument(0) final ITestResult result) {
122122
// "failed but within success percentage"
123123
result.setStatus(ITestResult.SUCCESS_PERCENTAGE_FAILURE);
124124
} else if (result.isSuccess() && ddRetryAnalyzer.shouldPropagateFailure()) {
125-
// Aligns session status with DD's reported result on EFD. Without this,
126-
// the session status would depend on the result order:
127-
// - pass + fail -> fail (correct)
128-
// - fail + pass -> pass (incorrect, EFD should fail on flaky)
125+
// mark status as failed to propagate an earlier failure suppressed by TestNG
129126
result.setStatus(ITestResult.FAILURE);
130127
result.setThrowable(
131128
new AssertionError(
132-
"Datadog Early Flake Detection: test has flaky results (mixed pass/fail)"));
129+
"Datadog: propagating test failure based on aggregated execution results"));
133130
}
134131
}
135132
}

0 commit comments

Comments
 (0)