diff --git a/tests/fixtures/docker/compose.override.mongodb.yaml b/tests/fixtures/docker/compose.override.mongodb.yaml index a853438f..cfcdb43e 100644 --- a/tests/fixtures/docker/compose.override.mongodb.yaml +++ b/tests/fixtures/docker/compose.override.mongodb.yaml @@ -5,6 +5,11 @@ services: teams-api: depends_on: [mongodb] image: us-central1-docker.pkg.dev/computer-vision-team/dev-docker/fiftyone-teams-api:${FIFTYONE_TEAMS_API_VERSION} + # Force unbuffered stdout so the startup log line is flushed immediately + # rather than sitting in a block buffer. Prevents flaky log assertions in + # the integration tests (see checkContainerLogsWithRetries). + environment: + PYTHONUNBUFFERED: "1" teams-app: depends_on: [mongodb] image: us-central1-docker.pkg.dev/computer-vision-team/dev-docker/fiftyone-teams-app:${FIFTYONE_TEAMS_APP_VERSION} diff --git a/tests/integration/compose/common_test.go b/tests/integration/compose/common_test.go index 22b6b405..46d041c2 100644 --- a/tests/integration/compose/common_test.go +++ b/tests/integration/compose/common_test.go @@ -42,8 +42,14 @@ func get_logs(t *testing.T, dockerOptions *docker.Options, container string) str } func checkContainerLogsWithRetries(subT *testing.T, dockerOptions *docker.Options, container string, tc string, expected string) { - maxRetries := 6 - retryDelay := 2 * time.Second + // Give the log assertion at least as much headroom as validate_endpoint + // (10 x 3s = 30s), plus margin. On loaded CI runners the larger compose + // stacks (e.g. dedicated plugins) can take longer to emit their startup + // line than the previous 6 x 2s (~12s) budget allowed, which caused + // non-deterministic failures where an otherwise-healthy container's log + // line had not yet surfaced within the window. + maxRetries := 15 + retryDelay := 3 * time.Second var log string