Skip to content

Make ExecCommandOnPod() context-aware in e2e pods test helper #1558

Description

@coderabbitai

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions