Skip to content

Commit

Permalink
revert to old behavior which was more stable
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Aug 21, 2021
1 parent f68864f commit 8dd8247
Showing 1 changed file with 4 additions and 6 deletions.
Expand Up @@ -108,7 +108,7 @@ public void workerShouldStopEvenIfInterruptExceptionConsumedWithinSubappender()
}

@Test(timeout = 2000)
public void noEventLoss() {
public void noEventLoss() throws InterruptedException {
int bufferSize = 10;
int loopLen = bufferSize * 2;
asyncAppenderBase.addAppender(delayingListAppender);
Expand Down Expand Up @@ -182,9 +182,8 @@ public void invalidQueueCapacityShouldResultInNonStartedAppender() {
statusChecker.assertContainsMatch("Invalid queue size");
}

@SuppressWarnings("deprecation")
@Test
public void workerThreadFlushesOnStop() {
public void workerThreadFlushesOnStop() throws InterruptedException {
int loopLen = 5;
int maxRuntime = (loopLen + 1) * Math.max(1000, delayingListAppender.delay);
ListAppender<Integer> la = delayingListAppender;
Expand All @@ -193,7 +192,7 @@ public void workerThreadFlushesOnStop() {
asyncAppenderBase.setMaxFlushTime(maxRuntime);
asyncAppenderBase.start();
asyncAppenderBase.worker.suspend();

for (int i = 0; i < loopLen; i++) {
asyncAppenderBase.doAppend(i);
}
Expand All @@ -207,7 +206,6 @@ public void workerThreadFlushesOnStop() {
verify(la, loopLen);
}

// @SuppressWarnings("deprecation")
@Test
public void stopExitsWhenMaxRuntimeReached() throws InterruptedException {
int maxFlushTime = 1; // runtime of 0 means wait forever, so use 1 ms instead
Expand All @@ -216,7 +214,7 @@ public void stopExitsWhenMaxRuntimeReached() throws InterruptedException {
asyncAppenderBase.addAppender(la);
asyncAppenderBase.setMaxFlushTime(maxFlushTime);
asyncAppenderBase.start();

for (int i = 0; i < loopLen; i++) {
asyncAppenderBase.doAppend(i);
}
Expand Down

0 comments on commit 8dd8247

Please sign in to comment.