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

Remove redundant condition in test #12517

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 @@ -2749,7 +2749,7 @@ public void testUpdateRowConcurrently()
verifyConcurrentUpdateFailurePermissible(trinoException);
}
catch (Throwable verifyFailure) {
if (trinoException != e && verifyFailure != e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good to me.

Only thing coming in my mind is that trinoException might be equal to e but that implies that the exception has a cycle/self-reference?

e.g.

catch (Exception e) {
  RuntimeException trinoException = getTrinoExceptionCause(e);
  e.addSuppressed(trinoException);
  throw new TrinoException(..., e);
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's possible & legit for e == trinoException:

RuntimeException trinoException = getTrinoExceptionCause(e);

simply e may be TrinoException itself.

if (verifyFailure != e) {
verifyFailure.addSuppressed(e);
}
throw verifyFailure;
Expand Down Expand Up @@ -2808,7 +2808,7 @@ public void testInsertRowConcurrently()
verifyConcurrentInsertFailurePermissible(trinoException);
}
catch (Throwable verifyFailure) {
if (trinoException != e && verifyFailure != e) {
if (verifyFailure != e) {
verifyFailure.addSuppressed(e);
}
throw verifyFailure;
Expand Down