MCPcopy
hub / github.com/docker/compose / checkServiceContainer

Function checkServiceContainer

pkg/e2e/scale_test.go:169–185  ·  pkg/e2e/scale_test.go::checkServiceContainer
(t *testing.T, stdout, containerName, containerState string, count int)

Source from the content-addressed store, hash-verified

167}
168
169func checkServiceContainer(t *testing.T, stdout, containerName, containerState string, count int) {
170 found := 0
171 lines := strings.SplitSeq(stdout, "\n")
172 for line := range lines {
173 if strings.Contains(line, containerName) && strings.Contains(line, containerState) {
174 found++
175 }
176 }
177 if found == count {
178 return
179 }
180 errMessage := fmt.Sprintf("expected %d but found %d instance(s) of container %s in stoud", count, found, containerName)
181 if containerState != "" {
182 errMessage += fmt.Sprintf(" with expected state %s", containerState)
183 }
184 t.Fatalf("%s\n%s", errMessage, stdout)
185}
186
187func TestScaleDownNoRecreate(t *testing.T) {
188 const projectName = "scale-down-recreated-test"

Callers 2

TestScaleBasicCasesFunction · 0.85
TestScaleWithDepsCasesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected