integration/dockertestutil: wait for libnetwork settle on reconnect

DisconnectContainerFromNetwork and ReconnectContainerToNetwork
returned as soon as the docker API call completed, but libnetwork
bridge reprogramming continued for several seconds after. The HA
disconnect tests then raced and bounced between healthy and broken
bridges. Poll until the container's endpoint is gone (on
disconnect) or reconciled (on reconnect), and on the
"conflicts with existing route" surface clear the stale subnet
route from the netns and retry. Settle is now baked into the
primitive so every caller benefits.
This commit is contained in:
Kristoffer Dalby 2026-05-13 13:16:48 +00:00
parent 98e9ff4d36
commit eec3844f24
2 changed files with 266 additions and 23 deletions

View file

@ -0,0 +1,12 @@
package dockertestutil
import "time"
// Docker control-plane retry policy. MaxElapsedTime sits above the
// worst observed libnetwork bridge reprogramming time (~60 s on
// contended GHA runners).
const (
DockerOpInitialInterval = 1 * time.Second
DockerOpMaxInterval = 10 * time.Second
DockerOpMaxElapsedTime = 90 * time.Second
)