Skip to content

Commit

Permalink
Sniff out internal failures in another way in CompilationTestHelper.
Browse files Browse the repository at this point in the history
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: 567340286
  • Loading branch information
graememorgan authored and Error Prone Team committed Sep 22, 2023
1 parent f243bcd commit 5430a32
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ public void doTest() {
fail(diagnostic.getMessage(Locale.ENGLISH));
}
}
String stringifiedOutput = outputStream.toString(UTF_8);
assertWithMessage("ErrorProne suffered an internal crash: %s", stringifiedOutput)
.that(stringifiedOutput)
.doesNotContain("An exception has occurred in the compiler");

if (expectNoDiagnostics) {
List<Diagnostic<? extends JavaFileObject>> diagnostics = diagnosticHelper.getDiagnostics();
assertWithMessage(
Expand Down

0 comments on commit 5430a32

Please sign in to comment.