Skip to content

Commit

Permalink
fix: wait for listening ports
Browse files Browse the repository at this point in the history
  • Loading branch information
fboulnois committed Jan 27, 2025
1 parent 5ec63c2 commit 054c7f7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import java.util.Random;
import java.util.UUID;
import org.apache.commons.lang3.RandomStringUtils;
import org.broadinstitute.consent.http.ConsentApplication;
import org.broadinstitute.consent.http.AbstractTestHelper;
import org.broadinstitute.consent.http.ConsentApplication;
import org.broadinstitute.consent.http.configurations.ConsentConfiguration;
import org.broadinstitute.consent.http.enumeration.OrganizationType;
import org.broadinstitute.consent.http.enumeration.UserFields;
Expand All @@ -33,6 +33,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.containers.wait.strategy.Wait;

public class DAOTestHelper extends AbstractTestHelper {

Expand Down Expand Up @@ -74,7 +75,8 @@ public class DAOTestHelper extends AbstractTestHelper {
public static void startUp() throws Exception {
// Start the database
postgresContainer = new PostgreSQLContainer<>(POSTGRES_IMAGE).
withCommand("postgres -c max_connections=" + maxConnections);
withCommand("postgres -c max_connections=" + maxConnections).
waitingFor(Wait.forListeningPorts());
postgresContainer.start();
ConfigOverride driverOverride = ConfigOverride.config("database.driverClass",
postgresContainer.getDriverClassName());
Expand Down

0 comments on commit 054c7f7

Please sign in to comment.