-
Notifications
You must be signed in to change notification settings - Fork 69
Description
Describe the bug
Ref. comment here: testcontainers/testcontainers-rs#742 (comment)
If I use a named volume mount with the TestContainers Postgres-module it works fine the first time the volume is created. But if new containers try to use the same volume later, the readiness check eventually times out and prints the following:
Error: WaitContainer(StartupTimeout)
This is weird, since if I check the logs from the Docker-container itself, database system is ready to accept connections is being printed (which the module checks for). And interacting with the container itself, and the database, it seems like it is ready.
To Reproduce
Code example:
Postgres::default()
.with_mount(Mount::volume_mount("named-psql-volume", "/var/lib/postgresql/data"))
.start()
.await?;I have created a repro here has well: https://github.com/cbrevik/named_mount/blob/main/src/main.rs
Steps:
- Run application with
cargo run - Stop the application (or in the repro above, it just exits right afterwards)
- Run it again with
cargo run - Wait a minute or so, the console prints `Error: WaitContainer(StartupTimeout)``
If I delete the named volume, e.g. named-psql-volume above here, then the application will start again (once).
Expected behavior
The container readiness check should pass, since it is ready. And I'd like to be able to re-use the same volume mount across different runs.