MCPcopy
hub / github.com/keploy/keploy / ComposeDownOnSetupFailure

Method ComposeDownOnSetupFailure

pkg/platform/http/agent.go:1322–1330  ·  view source on GitHub ↗

ComposeDownOnSetupFailure tears down the managed docker-compose stack so a retry after a per-test-set setup failure (e.g. agent-readiness timeout) does not hit a "container name already in use" conflict from the dependency containers/network left behind. No-op when there is no managed app or it is n

(_ context.Context)

Source from the content-addressed store, hash-verified

1320// containers/network left behind. No-op when there is no managed app or it is
1321// not a compose app (App.ComposeDown self-guards on kind == DockerCompose).
1322func (a *AgentClient) ComposeDownOnSetupFailure(_ context.Context) error {
1323 ap, err := a.getApp()
1324 if err != nil {
1325 a.logger.Debug("ComposeDownOnSetupFailure: no managed app to tear down")
1326 return nil
1327 }
1328 ap.ComposeDown()
1329 return nil
1330}
1331
1332func (a *AgentClient) startInDocker(ctx context.Context, logger *zap.Logger, opts models.SetupOptions) error {
1333 keployAlias, err := kdocker.GetKeployDockerAlias(ctx, logger, &config.Config{

Callers

nothing calls this directly

Calls 3

getAppMethod · 0.95
ComposeDownMethod · 0.80
DebugMethod · 0.65

Tested by

no test coverage detected