Fix flaky test TestDockerCommand_MacAddressConfig/default,_network_per_build_enabled

Root Cause

The TestDockerCommand_MacAddressConfig/default,_network_per_build_enabled sub-test is flaky because it uses require.Eventually with a 10-second timeout and 500ms polling interval to detect a running build container, while the job script only runs sleep 10. In slow CI environments (or when the network_per_build_enabled path has extra setup overhead), the container can be created and destroyed within the 10-second window without the polling loop ever observing it.

Fix

File modified: executors/docker/docker_command_integration_test.go

  1. Increased sleep 3sleep 10 — The build container now stays alive for 30 seconds, giving the polling loop a much larger observation window. The container cannot be created and destroyed before the polling loop has a chance to see it.

  2. Increased require.Eventually timeout: 10s60s — Handles slow CI environments where container creation itself takes longer than expected (e.g., image pulls, network setup).

  3. Reduced polling interval: 500ms100ms — More responsive polling reduces the chance of missing a short-lived container and makes the test faster in the common case.

Fixes failing pipeline

Session 6107902

Powered by Duo Fix Pipeline flow

Edited by Romuald Atchadé

Merge request reports

Loading
Loading