mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
test(rds): wait for the final PostgreSQL TCP listener (#6318)
Avoid accepting the temporary Unix-socket initialization server as ready before the endpoint refresh tests connect over TCP. Remove test-owned anonymous volumes with their containers. Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
1 parent
63d577a245
commit
510a1cbbb8
1 file changed
+3
-2
+3
-2
@@ -323,7 +323,8 @@ class RdsBackendEndpointRefreshIntegrationTest {
|
||||
}
|
||||
|
||||
private void waitForPostgres(String containerId) {
|
||||
String[] command = {"pg_isready", "-U", USER, "-d", DATABASE};
|
||||
// The image's temporary initialization server accepts only Unix-socket connections.
|
||||
String[] command = {"pg_isready", "-h", "127.0.0.1", "-U", USER, "-d", DATABASE};
|
||||
ContainerExec.Result lastResult = null;
|
||||
for (int attempt = 0; attempt < 60; attempt++) {
|
||||
lastResult = ContainerExec.run(dockerClient, containerId, command, 5);
|
||||
@@ -372,7 +373,7 @@ class RdsBackendEndpointRefreshIntegrationTest {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
dockerClient.removeContainerCmd(containerId).withForce(true).exec();
|
||||
dockerClient.removeContainerCmd(containerId).withForce(true).withRemoveVolumes(true).exec();
|
||||
} catch (DockerException ignored) {
|
||||
// best effort
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user