Skip to content

HDDS-10278. Simplify tests using assertDoesNotThrow#6291

Merged
adoroszlai merged 4 commits intoapache:masterfrom
wzhallright:HDDS-10278
Feb 28, 2024
Merged

HDDS-10278. Simplify tests using assertDoesNotThrow#6291
adoroszlai merged 4 commits intoapache:masterfrom
wzhallright:HDDS-10278

Conversation

@wzhallright
Copy link
Contributor

What changes were proposed in this pull request?

Simplify tests using assertDoesNotThrow

Please describe your PR in detail:

try {   
  <some action>   
} catch (...) {   
  fail()   
}

try-catch-fail can be changed to:

<setup>
assertDoesNotThrow(() -> <action which may throw>)

if the test does not have any assertions other than the fail() call being removed. (See HDDS-10277 for even more simpler solution if the test has other assertions.)

What is the link to the Apache JIRA

HDDS-10278

CI

https://github.com/wzhallright/ozone/actions/runs/8076086411

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @wzhallright for the patch. Mostly looks good, some minor improvements suggested.

@adoroszlai adoroszlai merged commit 4095ef1 into apache:master Feb 28, 2024
@adoroszlai
Copy link
Contributor

Thanks @wzhallright for the patch.

jojochuang pushed a commit to jojochuang/ozone that referenced this pull request Mar 15, 2024
(cherry picked from commit 4095ef1)
Change-Id: I47a27c2e87dc9d36e735103bc0ed8fcd63903e32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants