Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
[Exclusions] Missing fail is a fail (#5518)
Browse files Browse the repository at this point in the history
* missing fail

* welp
  • Loading branch information
jeremyk-91 authored Jun 25, 2021
1 parent 09c1776 commit aefcdac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ allprojects {
'JdkObsolete',
'LogSafePreconditionsMessageFormat',
'MathAbsoluteRandom',
'MissingFail',
'MissingSummary',
'MixedMutabilityReturnType',
'MockitoInternalUsage',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,7 @@ public void testTimedTryLockCanFail() throws Exception {
assertThat(anonymousReadLock.tryLock()).isNotNull();
anonymousReadLock.lock();
});
try {
future2.get(10, TimeUnit.MILLISECONDS);
} catch (TimeoutException expected) {
/* Expected. */
}
assertThatThrownBy(() -> future2.get(10, TimeUnit.MILLISECONDS)).isInstanceOf(TimeoutException.class);
future1.get(200, TimeUnit.MILLISECONDS);
future2.get(10, TimeUnit.MILLISECONDS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ private void assertBlockedThreadsAreDone(List<Future> futures, int numberBlocked
assertThat(exceptions.get()).isEqualTo(numberBlocked);
}

private void assertSuccessfulThreadsAreDone(List<Future> futures, int numberSuccessful)
throws InterruptedException, ExecutionException {
@SuppressWarnings("MissingFail") // This method *counts* successes and expects *some* to work
private void assertSuccessfulThreadsAreDone(List<Future> futures, int numberSuccessful) {
AtomicInteger successes = new AtomicInteger(0);
futures.forEach(future -> {
try {
Expand Down

0 comments on commit aefcdac

Please sign in to comment.