Skip to content

Commit

Permalink
allow more time for timetout
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Sep 6, 2024
1 parent b0876e5 commit 3b5d041
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public class SMTPAppender_GreenTest {

static final boolean SYNCHRONOUS = false;
static final boolean ASYNCHRONOUS = true;

static int TIMEOUT = 3000;

int port = RandomUtil.getRandomServerPort();
// GreenMail cannot be static. As a shared server induces race conditions
GreenMail greenMailServer;
Expand Down Expand Up @@ -160,10 +161,12 @@ private MimeMultipart verifyAndExtractMimeMultipart(String subject)
return (MimeMultipart) mm.getContent();
}



void waitUntilEmailIsSent() throws InterruptedException {
ExecutorService es = loggerContext.getExecutorService();
es.shutdown();
boolean terminated = es.awaitTermination(1000, TimeUnit.MILLISECONDS);
boolean terminated = es.awaitTermination(TIMEOUT, TimeUnit.MILLISECONDS);
// this assertion may be needlessly strict
if(!terminated) {
fail("executor elapsed before accorded delay");
Expand Down

0 comments on commit 3b5d041

Please sign in to comment.