mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-23 08:23:07 -04:00
These tests have race conditions where they assume immediate state
visibility after a pod transitions to Running. The current code works
on fast runtimes but is fundamentally racy: kubelet log streaming,
log file flushing, and container status updates are eventually
consistent, not synchronous.
Switching to gomega.Eventually polling makes the tests deterministic.
The success path on fast runtimes is unchanged (polling succeeds on
first attempt), but the tests now correctly handle scenarios where
state takes a moment to propagate. This benefits any environment
where containers may take longer to start (VM-isolated runtimes such
as Kata, gVisor, and Windows Hyper-V; overloaded CI VMs; shared
multi-tenant clusters).
- ephemeral_containers.go (both 'should be added' and 'should update'
tests): the 'polo' log-content check is polled via gomega.Eventually
with f.Timeouts.PodStartShort. The container may report Running
before its first stdout has been flushed.
- lifecycle_hook.go ('ignore terminated container'): use
f.Timeouts.PodDelete instead of gracePeriod*time.Second for the
termination wait. The actual correctness check (container's intrinsic
StartedAt/FinishedAt < sleepSeconds) is unchanged and unaffected by
how long we waited.
- pods.go ('retrieving logs from the container over websockets'):
poll the websocket open and read via gomega.Eventually. The container
can be reported Running before its first stdout line has been flushed,
so opening the websocket immediately may return an empty or partial
buffer.
|
||
|---|---|---|
| .. | ||
| framework | ||
| configmap.go | ||
| container.go | ||
| container_probe.go | ||
| container_restart_policy.go | ||
| containers.go | ||
| downwardapi.go | ||
| ephemeral_containers.go | ||
| expansion.go | ||
| file_key.go | ||
| framework.go | ||
| image_credential_provider.go | ||
| image_volume.go | ||
| init_container.go | ||
| kubelet.go | ||
| kubelet_etc_hosts.go | ||
| lease.go | ||
| lifecycle_hook.go | ||
| node_lease.go | ||
| OWNERS | ||
| pod_admission.go | ||
| pod_hostnameoverride.go | ||
| pod_level_resources.go | ||
| pod_level_resources_resize.go | ||
| pod_resize.go | ||
| pods.go | ||
| podtemplates.go | ||
| privileged.go | ||
| runtime.go | ||
| runtimeclass.go | ||
| secrets.go | ||
| security_context.go | ||
| sysctl.go | ||