Summary
Make ExecCommandOnPod() in test/e2e/performanceprofile/functests/utils/pods/pods.go context-aware so callers can bound exec calls with a timeout/cancellation, instead of the helper internally using exec.StreamWithContext(context.TODO(), ...).
Rationale
During review of PR #1556, it was noted that new GOMAXPROCS-related e2e tests in test/e2e/performanceprofile/functests/1_performance/performance.go call pods.ExecCommandOnPod(), which is unbounded because the underlying helper uses context.TODO(). This means a stalled SPDY exec session could hang indefinitely, even though the pod cleanup path (DeferCleanup) was already fixed to use context.WithTimeout(...).
Since ExecCommandOnPod() is a shared utility used across many e2e tests, changing its signature/behavior was deferred to a follow-up to avoid unintended impact on other tests.
Affected areas
test/e2e/performanceprofile/functests/utils/pods/pods.go (ExecCommandOnPod implementation)
- Call sites across
test/e2e/performanceprofile/functests/... that use ExecCommandOnPod()
Acceptance criteria
ExecCommandOnPod() (or a new context-aware variant) accepts a context.Context parameter and passes it through to exec.StreamWithContext(...) instead of using context.TODO() internally.
- Existing call sites are updated to pass an appropriate context (e.g., with a timeout), or a backward-compatible wrapper is provided to avoid breaking existing tests.
- No regression in existing e2e test suites that rely on this helper.
References
Requested by: @mrniranjan
Summary
Make
ExecCommandOnPod()intest/e2e/performanceprofile/functests/utils/pods/pods.gocontext-aware so callers can bound exec calls with a timeout/cancellation, instead of the helper internally usingexec.StreamWithContext(context.TODO(), ...).Rationale
During review of PR #1556, it was noted that new GOMAXPROCS-related e2e tests in
test/e2e/performanceprofile/functests/1_performance/performance.gocallpods.ExecCommandOnPod(), which is unbounded because the underlying helper usescontext.TODO(). This means a stalled SPDY exec session could hang indefinitely, even though the pod cleanup path (DeferCleanup) was already fixed to usecontext.WithTimeout(...).Since
ExecCommandOnPod()is a shared utility used across many e2e tests, changing its signature/behavior was deferred to a follow-up to avoid unintended impact on other tests.Affected areas
test/e2e/performanceprofile/functests/utils/pods/pods.go(ExecCommandOnPodimplementation)test/e2e/performanceprofile/functests/...that useExecCommandOnPod()Acceptance criteria
ExecCommandOnPod()(or a new context-aware variant) accepts acontext.Contextparameter and passes it through toexec.StreamWithContext(...)instead of usingcontext.TODO()internally.References
Requested by: @mrniranjan