mirror of
https://github.com/google/nomulus
synced 2026-01-06 13:36:48 +00:00
Implement changes suggested by testcontainer dev (#426)
* Implement changes suggested by testcontainer dev See https://github.com/google/nomulus/issues/401 Specifically: - Use getContainerIpAddress() instead of localhost to insulate us from off-machine docker usage. - Remove shutdown hook to close the container, as testcontainers does this for us.
This commit is contained in:
@@ -97,7 +97,6 @@ abstract class JpaTransactionManagerRule extends ExternalResource {
|
||||
new PostgreSQLContainer(NomulusPostgreSql.getDockerTag())
|
||||
.withDatabaseName(MANAGEMENT_DB_NAME);
|
||||
container.start();
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> container.close()));
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,8 @@ class DockerWebDriverRule extends ExternalResource {
|
||||
url =
|
||||
new URL(
|
||||
String.format(
|
||||
"http://localhost:%d/wd/hub",
|
||||
"http://%s:%d/wd/hub",
|
||||
container.getContainerIpAddress(),
|
||||
container.getMappedPort(CHROME_DRIVER_SERVICE_PORT)));
|
||||
} catch (MalformedURLException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
|
||||
Reference in New Issue
Block a user