Skip to content

Commit 5abc8e5

Browse files
graememorganError Prone Team
authored andcommitted
Sniff out internal failures in another way in CompilationTestHelper.
I had a mysteriously failing test (failing with no diagnostics) which was failing with a `NoSuchMethodError` in the constructor. I'm not at all sure this is the right fix! PiperOrigin-RevId: 567605302
1 parent f243bcd commit 5abc8e5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎test_helpers/src/main/java/com/google/errorprone/CompilationTestHelper.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ public void doTest() {
313313
fail(diagnostic.getMessage(Locale.ENGLISH));
314314
}
315315
}
316+
String stringifiedOutput = outputStream.toString(UTF_8);
317+
assertWithMessage("ErrorProne suffered an internal crash: %s", stringifiedOutput)
318+
.that(stringifiedOutput)
319+
.doesNotContain("An exception has occurred in the compiler");
320+
316321
if (expectNoDiagnostics) {
317322
List<Diagnostic<? extends JavaFileObject>> diagnostics = diagnosticHelper.getDiagnostics();
318323
assertWithMessage(

0 commit comments

Comments
 (0)