Skip to content
This repository was archived by the owner on May 12, 2020. It is now read-only.
This repository was archived by the owner on May 12, 2020. It is now read-only.

Connection error on Windows during AppVeyor build #86

@edrdo

Description

@edrdo

Hi,

I've been using postgresql-embedded for tests in JDBDT (http://github.com/edrdo/jdbdt) without any problems on MacOS and Linux. I was just trying to enable AppVeyor continuous integration for Windows builds when I encounted some errors.

The way I use postgresql-embedded is simple (full code here
in https://github.com/edrdo/jdbdt/blob/master/src/test/java/org/jdbdt/postgresql/PostgreSQLSuite.java)

On setup I have:

  postgres = new EmbeddedPostgres(Version.V9_6_2);
  Path cachePath = FileSystems.getDefault().getPath(System.getProperty("user.home") + "/.embedpostgresql/");
  String url = postgres.start(EmbeddedPostgres.cachedRuntimeConfig(cachePath));

During a AppVeyor build - check https://ci.appveyor.com/project/edrdo/jdbdt/build/3 - the JDBC driver is unable to connect to the embedded Postgres database.

   org.postgresql.util.PSQLException: Connection to localhost:1047 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:265)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:194)
at org.postgresql.Driver.makeConnection(Driver.java:450)
at org.postgresql.Driver.connect(Driver.java:252)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)

Maybe this is an Appveyor issue with restricted port use? In that case how can I configure the port for the "cached runtime config" . More generally, the point of the cached config is to avoid downloading the PostgreSQL binaries, but I gather that there is no way to set the URL parameters (name, pass, port, etc). I looked up the postgresql-embedded source code but I couldn't determine how to set up these together with a cached config, probably I'm missing something ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions