Skip to content

Commit

Permalink
add more comments about issue #27 which causes tests flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
xmik committed Feb 4, 2024
1 parent 5a344fe commit 5b25547
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docker_compose_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ func (dc DockerComposeDriver) getDefaultContainerID(containersNames []string) st
//
// The output for docker-compose >2 does not show the default container. In order to have it included, we need to run `ps --all`
//
// Returns: container names, error
// Returns: container names
func (dc DockerComposeDriver) getDCContainersNames(mergedConfig Config, projectName string) []string {
if projectName == "" {
panic("projectName was empty")
Expand All @@ -647,6 +647,10 @@ func (dc DockerComposeDriver) getDCContainersNames(mergedConfig Config, projectN
cmdInfo := cmdInfoToString(cmd, stdout, stderr, exitStatus)
if strings.Contains(stderr, "No such container") {
// Workaround for issue #27: do not panic but print error level log message.
// This happens rarely and seems similar to
// https://github.com/docker/compose/issues/9534 and
// https://github.com/docker/compose/issues/10373
// and this makes the tests such as test_docker_compose_run_preserves_bash_functions flaky
dc.Logger.Log("error", fmt.Sprintf("Unexpected exit status:\n%s", cmdInfo))
return []string{}
} else {
Expand Down

0 comments on commit 5b25547

Please sign in to comment.