Skip to content

Commit

Permalink
Merge pull request #1735 from treasure-data/backport-workaround-PyIT-…
Browse files Browse the repository at this point in the history
…failure-2

Fix PyIT retry again.
  • Loading branch information
yoyama committed Apr 18, 2022
2 parents 37a7765 + b66448f commit 6202d61
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions digdag-tests/src/test/java/acceptance/td/PyIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.digdag.client.api.Id;
import io.digdag.client.api.RestSessionAttempt;
import io.digdag.client.config.Config;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -34,8 +35,8 @@ public class PyIT

@Rule
public TemporaryFolder folder = new TemporaryFolder();
@Rule
public TemporaryDigdagServer server = TemporaryDigdagServer.of();
// Not set Rule. It is initialized in setUp()
public TemporaryDigdagServer server;

private String accessKeyId;
private String secretAccessKey;
Expand Down Expand Up @@ -101,6 +102,16 @@ public void setUp()
.build();
}

@After
public void stopServer()
throws Exception
{
if (server != null) {
server.close();
server = null;
}
}

@Test
public void testRunOnEcsWithRetry()
throws Exception
Expand All @@ -111,14 +122,16 @@ public void testRunOnEcsWithRetry()
testRunOnEcs();
return;
} catch (AssertionError ae) {
logger.warn("testRunOnEcs() failed. {}", ae.toString());
logger.error("testRunOnEcs() failed. {}", ae.toString());
if (i + 1 == MAX_RETRY) {
logger.error("All try of testRunOnEcs() failed.");
throw ae;
}
else {
logger.warn("Retrying...");
logger.error("Retrying...");
server.close();
Thread.sleep(10*1000);
setUp();
}
}
}
Expand Down

0 comments on commit 6202d61

Please sign in to comment.