openshift / openshift/cluster-node-tuning-operator
Make ExecCommandOnPod() context-aware in e2e pods test helper
@mrniranjan is already working on this.
Since Jul 8, 2026.
- Dominant language
- Go
- Stars
- 121
- Forks
- 136
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 21
Description
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(ExecCommandOnPodimplementation)- Call sites across
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.- 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
- PR: https://github.com/openshift/cluster-node-tuning-operator/pull/1556
- Discussion: https://github.com/openshift/cluster-node-tuning-operator/pull/1556#discussion_r3528568934
Requested by: @mrniranjan
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.