fix(docdb,neptune): stop containers and proxies on emulator shutdown (#1452)

onStop() only tore down ElastiCache and RDS; the DocDb/Neptune managers
expose stopAll() but were never called, leaking containers and proxy
ports across runs. Wire them in (proxies before containers) and verify
in EmulatorLifecycleTest.
This commit is contained in:
Ahmed khaled authored and GitHub committed 2026-06-19 19:13:21 -05:00
1 parent b4ee4ca489
commit 8e23e740e7
2 files changed
+30 -1

No files matched your search

@@ -11,9 +11,12 @@ import io.github.hectorvent.floci.services.floci.ui.FlociUiManager;
import io.github.hectorvent.floci.services.elasticache.container.ElastiCacheContainerManager;
import io.github.hectorvent.floci.services.elasticache.container.ElastiCacheMemcachedContainerManager;
import io.github.hectorvent.floci.services.elasticache.proxy.ElastiCacheProxyManager;
import io.github.hectorvent.floci.services.docdb.container.DocDbContainerManager;
import io.github.hectorvent.floci.services.lambda.DynamoDbStreamsEventSourcePoller;
import io.github.hectorvent.floci.services.lambda.KinesisEventSourcePoller;
import io.github.hectorvent.floci.services.lambda.SqsEventSourcePoller;
import io.github.hectorvent.floci.services.neptune.container.NeptuneContainerManager;
import io.github.hectorvent.floci.services.neptune.proxy.NeptuneProxyManager;
import io.github.hectorvent.floci.services.pipes.PipesService;
import io.github.hectorvent.floci.services.rds.RdsService;
import io.github.hectorvent.floci.services.rds.container.RdsContainerManager;
@@ -59,6 +62,9 @@ public class EmulatorLifecycle {
private final ElastiCacheProxyManager elastiCacheProxyManager;
private final RdsContainerManager rdsContainerManager;
private final RdsProxyManager rdsProxyManager;
private final DocDbContainerManager docDbContainerManager;
private final NeptuneContainerManager neptuneContainerManager;
private final NeptuneProxyManager neptuneProxyManager;
private final RdsService rdsService;
private final InitializationHooksRunner initializationHooksRunner;
private final SqsEventSourcePoller sqsPoller;
@@ -78,6 +84,9 @@ public class EmulatorLifecycle {
ElastiCacheProxyManager elastiCacheProxyManager,
RdsContainerManager rdsContainerManager,
RdsProxyManager rdsProxyManager,
DocDbContainerManager docDbContainerManager,
NeptuneContainerManager neptuneContainerManager,
NeptuneProxyManager neptuneProxyManager,
RdsService rdsService,
InitializationHooksRunner initializationHooksRunner,
SqsEventSourcePoller sqsPoller,
@@ -96,6 +105,9 @@ public class EmulatorLifecycle {
this.elastiCacheProxyManager = elastiCacheProxyManager;
this.rdsContainerManager = rdsContainerManager;
this.rdsProxyManager = rdsProxyManager;
this.docDbContainerManager = docDbContainerManager;
this.neptuneContainerManager = neptuneContainerManager;
this.neptuneProxyManager = neptuneProxyManager;
this.rdsService = rdsService;
this.initializationHooksRunner = initializationHooksRunner;
this.sqsPoller = sqsPoller;
@@ -218,9 +230,12 @@ public class EmulatorLifecycle {
}
elastiCacheProxyManager.stopAll();
rdsProxyManager.stopAll();
neptuneProxyManager.stopAll();
elastiCacheContainerManager.stopAll();
elastiCacheMemcachedContainerManager.stopAll();
rdsContainerManager.stopAll();
docDbContainerManager.stopAll();
neptuneContainerManager.stopAll();
ecrRegistryManager.shutdown();
flociUiManager.shutdown();
storageFactory.shutdownAll();