Coder Social home page Coder Social logo

Comments (4)

dimafeng avatar dimafeng commented on July 30, 2024 1

Hi @nefilim sorry to hear that you have problems with this. I'm afraid that I agree with you that it's not the scala wrapper problem. I don't see anything that overrides the core (java) lib behavior.

from testcontainers-scala.

nefilim avatar nefilim commented on July 30, 2024

Ok I see what's going on here - when looking at the failed container log output, it's only receiving STDERR output, for some reason STDOUT has not been connected?

Seems pretty odd for the container to log the message that's being waited for twice in the LogMessageWaitStrategy once on STDERR and once on STDOUT?

snippet from a working run:

STDERR: WARNING: enabling "trust" authentication for local connections
STDERR: You can change this by editing pg_hba.conf or using the option -A, or
STDERR: --auth-local and --auth-host, the next time you run initdb.
STDOUT: waiting for server to start....2022-10-12 21:56:44.641 UTC [48] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
STDOUT: 2022-10-12 21:56:44.648 UTC [49] LOG:  database system was shut down at 2022-10-12 21:56:44 UTC
STDOUT: 2022-10-12 21:56:44.651 UTC [48] LOG:  database system is ready to accept connections
STDOUT:  done
STDOUT: server started
STDOUT: CREATE DATABASE
STDOUT: 
STDOUT: 
STDOUT: /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
STDOUT: 
STDOUT: waiting for server to shut down...2022-10-12 21:56:45.020 UTC [48] LOG:  received fast shutdown request
STDOUT: .2022-10-12 21:56:45.020 UTC [48] LOG:  aborting any active transactions
STDOUT: 2022-10-12 21:56:45.023 UTC [48] LOG:  background worker "logical replication launcher" (PID 55) exited with exit code 1
STDOUT: 2022-10-12 21:56:45.023 UTC [50] LOG:  shutting down
STDOUT: 2022-10-12 21:56:45.032 UTC [48] LOG:  database system is shut down
STDOUT:  done
STDOUT: server stopped
STDOUT: 
STDOUT: PostgreSQL init process complete; ready for start up.
STDOUT: 
STDERR: 2022-10-12 21:56:45.133 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
STDERR: 2022-10-12 21:56:45.133 UTC [1] LOG:  listening on IPv6 address "::", port 5432
STDERR: 2022-10-12 21:56:45.133 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
STDERR: 2022-10-12 21:56:45.141 UTC [76] LOG:  database system was shut down at 2022-10-12 21:56:45 UTC
STDERR: 2022-10-12 21:56:45.143 UTC [1] LOG:  database system is ready to accept connections

vs a broken run:

20:56:09.486 [io-compute-12] ERROR 🐳 [postgres:11] - Log output from the failed container:
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
2022-10-12 20:55:10.614 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-10-12 20:55:10.614 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2022-10-12 20:55:10.614 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-10-12 20:55:10.624 UTC [77] LOG:  database system was shut down at 2022-10-12 20:55:10 UTC
2022-10-12 20:55:10.627 UTC [1] LOG:  database system is ready to accept connections

from testcontainers-scala.

nefilim avatar nefilim commented on July 30, 2024

@kiview any thoughts? especially with the new information I found? Feels a little bit like a race condition...

from testcontainers-scala.

kiview avatar kiview commented on July 30, 2024

@nefilim Thanks, I'll re-open the issue at testcontainers-java with the new information.

Regarding logging on STDOUT and STDERR for PotgreSQL, that's unfortunately how their image works. It is in parts documented in the discussion around this PR for more flexible PostgreSQL Wait Strategy:
testcontainers/testcontainers-java#5501 (comment)

from testcontainers-scala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.