0
Oracleとの統合テストにtestcontainersライブラリを使用しようとしました。ここでは簡単なテストです:TestContainers Oracle TimeoutException
public class SimpleTest {
@Rule
public OracleContainer oracle = new OracleContainer();
@Test
public void simpleTest() throws SQLException {
HikariDataSource ds = buildHikariDataSource();
Statement statement = ds.getConnection().createStatement();
statement.execute("SELECT 1 FROM dual");
ResultSet resultSet = statement.getResultSet();
resultSet.next();
int resultSetInt = resultSet.getInt(1);
assertEquals("A basic SELECT query succeeds", 1, resultSetInt);
}
private HikariDataSource buildHikariDataSource() {
HikariConfig hikariConfig = new HikariConfig();
hikariConfig.setJdbcUrl(oracle.getJdbcUrl());
hikariConfig.setUsername(oracle.getUsername());
hikariConfig.setPassword(oracle.getPassword());
return new HikariDataSource(hikariConfig);
}
}
But it fails with TimeoutException:
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:256)
at org.testcontainers.containers.GenericContainer.lambda$start$0(GenericContainer.java:184)
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76)
... 18 more
Caused by: org.rnorth.ducttape.TimeoutException: org.rnorth.ducttape.TimeoutException: java.util.concurrent.TimeoutException
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:53)
at org.testcontainers.containers.JdbcDatabaseContainer.waitUntilContainerStarted(JdbcDatabaseContainer.java:81)
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:235)
... 20 more
マイドッカーのインストールがtestcontainers-オラクル-XEおよびOSと適しているMacOSのシエラ10.12.6です。
この問題を解決するにはどうすればよいですか?
P.S. Full console output
完全なスタックトレースを投稿できますか? –