MCPcopy Create free account
hub / github.com/efficientgo/e2e / Kill

Method Kill

env_docker.go:488–506  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

486}
487
488func (d *dockerRunnable) Kill() error {
489 if !d.IsRunning() {
490 return nil
491 }
492
493 d.logger.Log("Killing", d.Name())
494
495 if out, err := d.env.exec("docker", "kill", d.containerName()).CombinedOutput(); err != nil {
496 d.logger.Log(string(out))
497 return err
498 }
499
500 // Wait until the container actually stopped. However, this could fail if
501 // the container already exited, so we just ignore the error.
502 _, _ = d.env.exec("docker", "wait", d.containerName()).CombinedOutput()
503
504 d.usedNetworkName = ""
505 return d.env.registerStopped(d.Name())
506}
507
508// Endpoint returns external (from host perspective) service endpoint (host:port) for given port name.
509// External means that it will be accessible only from host, but not from docker containers.

Callers

nothing calls this directly

Calls 6

IsRunningMethod · 0.95
NameMethod · 0.95
containerNameMethod · 0.95
registerStoppedMethod · 0.80
LogMethod · 0.65
execMethod · 0.45

Tested by

no test coverage detected