Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PyIT retry again. #1735

Merged
merged 1 commit into from
Apr 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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