Skip to content

Commit f7642da

Browse files
authored
fix(integ-runner): long-running tests warnings are displayed as errors (#994)
This change introduces a new `TEST_WARNING` diagnostic reason to distinguish non-failing warnings from actual errors in the integration test runner. Previously, when a test took longer than 60 seconds, it would emit a `SNAPSHOT_ERROR` diagnostic, which was misleading since the test hadn't actually failed yet. The new warning diagnostic allows the runner to inform users about long-running tests without treating them as errors. This provides better visibility into test performance while maintaining the distinction between warnings and actual failures. The warning is displayed with a `WARN` prefix in the output, making it clear that the test is still running but taking longer than expected. ### Before <img width="611" height="137" alt="image" src="https://github.com/user-attachments/assets/20dda1c3-4bec-461f-bbed-8246dacdc38a" /> ### After ``` @aws-cdk/aws-lambda-python-alpha: WARN integ.function.nodeps 60.003s @aws-cdk/aws-lambda-python-alpha: Test is taking a very long time @aws-cdk/aws-lambda-python-alpha: WARN integ.function.sub 60.006s @aws-cdk/aws-lambda-python-alpha: Test is taking a very long time @aws-cdk/aws-lambda-python-alpha: WARN integ.function.poetry 60.002s @aws-cdk/aws-lambda-python-alpha: Test is taking a very long time @aws-cdk/aws-lambda-python-alpha: WARN integ.function.pipenv 60.002s @aws-cdk/aws-lambda-python-alpha: Test is taking a very long time ``` --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 672ee1c commit f7642da

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/@aws-cdk/integ-runner/lib/workers/common.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ export enum DiagnosticReason {
191191
*/
192192
TEST_ERROR = 'TEST_ERROR',
193193

194+
/**
195+
* A non-failing warning from the integration test run
196+
*/
197+
TEST_WARNING = 'TEST_WARNING',
198+
194199
/**
195200
* The snapshot test failed because the actual
196201
* snapshot was different than the expected snapshot
@@ -294,6 +299,9 @@ export function printResults(diagnostic: Diagnostic): void {
294299
case DiagnosticReason.SNAPSHOT_FAILED:
295300
logger.error(' CHANGED %s %s\n%s', diagnostic.testName, chalk.gray(`${diagnostic.duration}s`), indentLines(diagnostic.message, 6));
296301
break;
302+
case DiagnosticReason.TEST_WARNING:
303+
logger.warning(' WARN %s %s\n%s', diagnostic.testName, chalk.gray(`${diagnostic.duration}s`), indentLines(diagnostic.message, 6));
304+
break;
297305
case DiagnosticReason.SNAPSHOT_ERROR:
298306
case DiagnosticReason.TEST_ERROR:
299307
logger.error(' ERROR %s %s\n%s', diagnostic.testName, chalk.gray(`${diagnostic.duration}s`), indentLines(diagnostic.message, 6));

packages/@aws-cdk/integ-runner/lib/workers/extract/extract_worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export async function snapshotTestWorker(testInfo: IntegTestInfo, options: Snaps
132132

133133
const timer = setTimeout(() => {
134134
workerpool.workerEmit({
135-
reason: DiagnosticReason.SNAPSHOT_ERROR,
135+
reason: DiagnosticReason.TEST_WARNING,
136136
testName: test.testName,
137137
message: 'Test is taking a very long time',
138138
duration: (Date.now() - start) / 1000,

0 commit comments

Comments
 (0)