Comments (4)
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.
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.
@kiview any thoughts? especially with the new information I found? Feels a little bit like a race condition...
from testcontainers-scala.
@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)
- MySQLContainer Random Port HOT 3
- Reuse container between test suits HOT 1
- localstack-v2 require aws sdk 1.x and 2.x HOT 2
- ContainerFetchException when running in Gitub CI
- Consider removing old API syntax from documentation HOT 2
- Container failed to start on GHA HOT 1
- "Keep getting: open `': Change reported by S3 during open at position 0. ETag was unavailable" when reading from S3
- Make TestContainersSuite public
- Multiple Suites with Single Container HOT 2
- Run DockerComposeContainer on GitLab CI
- sqlserver got Mapped port can only be obtained after the container is started error HOT 2
- NoClassDefFoundError: munit/Test since 0.40.15 HOT 2
- Errors in container startup are silently ignored and test skipped
- NoClassDefFoundError: munit/Test - With `testcontainers-scala-munit` versions above 0.40.14 HOT 2
- 0.41.0: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image alpine/socat:1.7.4.3-r0 HOT 8
- Issue while trying to use PostGis in testcontainer initialization.
- Docker Compose V2 Standalone
- when to use `ForAllTestContainer` over `TestContainersForAll`
- Local Docker Compose with V2 Not Found in Path Error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testcontainers-scala.