Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match regex for query retries just like Flaky annotation processor does #6944

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import javax.inject.Inject;

import java.time.temporal.ChronoUnit;
import java.util.regex.Pattern;

public class HiveProductTest
extends ProductTest
Expand All @@ -43,8 +44,9 @@ public class HiveProductTest

private static boolean isErrorCommittingToHive(Throwable throwable)
{
return Throwables.getCausalChain(throwable).stream()
.anyMatch(exception -> exception.getMessage().matches(ERROR_COMMITTING_WRITE_TO_HIVE_MATCH));
return Pattern.compile(ERROR_COMMITTING_WRITE_TO_HIVE_MATCH)
.matcher(Throwables.getStackTraceAsString(throwable))
.find();
}

@Inject
Expand Down