Skip to content

Commit

Permalink
fix a test asserting no log content now that throwIfFatal logs
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbasle committed Aug 1, 2022
1 parent 31912b1 commit 7c93a85
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -209,9 +209,9 @@ void onNextConsumerFatalDoesntTriggerCancellation(TestLogger testLogger) {
TestSubscription testSubscription = new TestSubscription();
tested.onSubscribe(testSubscription);

//the error is expected to be thrown as it is fatal, so it doesn't go through onErrorDropped
//the error is expected to be thrown as it is fatal, so it doesn't go through onErrorDropped. However, throwIfJvmFatal now logs it.
assertThatExceptionOfType(OutOfMemoryError.class).isThrownBy(() -> tested.onNext("foo"));
Assertions.assertThat(testLogger.getErrContent()).isEmpty();
Assertions.assertThat(testLogger.getErrContent()).startsWith("[ WARN] throwIfFatal detected a jvm fatal exception, which is thrown and logged below: - java.lang.OutOfMemoryError");

assertThat(testSubscription.isCancelled).as("subscription isCancelled")
.isFalse();
Expand Down

0 comments on commit 7c93a85

Please sign in to comment.