Skip to content

Commit 3be2005

Browse files
committed
Revert "BSR also work around the currently broken cosmos db emulator image"
This reverts commit 6d5b6ef.
1 parent 6d5b6ef commit 3be2005

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

modules/azure/src/main/java/org/testcontainers/containers/CosmosDBEmulatorContainer.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import org.testcontainers.utility.DockerImageName;
55

66
import java.security.KeyStore;
7-
import java.time.Duration;
87

98
/**
109
* Testcontainers implementation for CosmosDB Emulator.
@@ -15,8 +14,6 @@
1514
*/
1615
public class CosmosDBEmulatorContainer extends GenericContainer<CosmosDBEmulatorContainer> {
1716

18-
static final String CERTIFICATE_ENDPOINT = "/_explorer/emulator.pem";
19-
2017
private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse(
2118
"mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator"
2219
);
@@ -30,16 +27,13 @@ public CosmosDBEmulatorContainer(final DockerImageName dockerImageName) {
3027
super(dockerImageName);
3128
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
3229
withExposedPorts(PORT);
33-
// Wait.forLogMessage(".*Started\\r\\n$") is not sufficient with the current version of cosmos db emulator (vnext-EN20251022),
34-
// see https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/209 .
35-
// On my machine it typically takes around 110s (!) before this endpoint becomes available.
36-
waitingFor(Wait.forHttps(CERTIFICATE_ENDPOINT).allowInsecure().withStartupTimeout(Duration.ofSeconds(180)));
30+
waitingFor(Wait.forLogMessage(".*Started\\r\\n$", 1));
3731
}
3832

3933
/**
4034
* @return new KeyStore built with PKCS12
4135
*/
42-
public KeyStore buildNewKeyStore() throws InterruptedException {
36+
public KeyStore buildNewKeyStore() {
4337
return KeyStoreBuilder.buildByDownloadingCertificate(getEmulatorEndpoint(), getEmulatorKey());
4438
}
4539

modules/azure/src/main/java/org/testcontainers/containers/KeyStoreBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private static OkHttpClient buildTrustAllClient(TrustManager[] trustManagers) th
6565
}
6666

6767
private static Request buildRequest(String endpoint) {
68-
return new Request.Builder().get().url(endpoint + CosmosDBEmulatorContainer.CERTIFICATE_ENDPOINT).build();
68+
return new Request.Builder().get().url(endpoint + "/_explorer/emulator.pem").build();
6969
}
7070

7171
private static KeyStore buildKeyStore(InputStream certificateStream, String keyStorePassword) throws Exception {

0 commit comments

Comments
 (0)