fix test pattern matching for jdk11 (#7602)

This change makes the error pattern more generic to account for
differences between JDK versions.
This commit is contained in:
Xavier Léauté 2019-05-06 21:02:44 -07:00 committed by GitHub
parent c58aa2f2ab
commit b3c7463059
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -161,6 +161,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
public class AppenderatorDriverRealtimeIndexTaskTest
{
@ -1242,8 +1243,12 @@ public class AppenderatorDriverRealtimeIndexTaskTest
IngestionStatsAndErrorsTaskReportData reportData = getTaskReportData();
Assert.assertEquals(expectedMetrics, reportData.getRowStats());
Assert.assertTrue(status.getErrorMsg()
.contains("java.lang.IllegalArgumentException\n\tat java.nio.Buffer.position"));
Pattern errorPattern = Pattern.compile(
"(?s)java\\.lang\\.IllegalArgumentException.*\n"
+ "\tat (java\\.base/)?java\\.nio\\.Buffer\\..*"
);
Assert.assertTrue(errorPattern.matcher(status.getErrorMsg()).matches());
}
}