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

Conversation

findepi
Copy link
Member

@findepi findepi commented May 23, 2022

No description provided.

@findepi findepi added the no-release-notes This pull request does not require release notes entry label May 23, 2022
@findepi findepi requested review from ebyhr and hashhar May 23, 2022 16:03
@cla-bot cla-bot bot added the cla-signed label May 23, 2022
@ebyhr
Copy link
Member

ebyhr commented May 24, 2022

CI hit #12300

@@ -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.

Copy link
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

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

Looks good to me

@findepi findepi merged commit 319d40e into trinodb:master May 24, 2022
@findepi findepi deleted the findepi/remove-redundant-condition-in-test-06ceec branch May 24, 2022 08:50
@findepi findepi added the test label May 24, 2022
@github-actions github-actions bot added this to the 382 milestone May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed no-release-notes This pull request does not require release notes entry test
Development

Successfully merging this pull request may close these issues.

3 participants