Skip to content

fix: add RestartPolicy Always to UI sidecar containers to prevent Job…#1782

Merged
bsquizz merged 1 commit into
RedHatInsights:masterfrom
mmusil:iqe-cji-completion
Jun 8, 2026
Merged

fix: add RestartPolicy Always to UI sidecar containers to prevent Job…#1782
bsquizz merged 1 commit into
RedHatInsights:masterfrom
mmusil:iqe-cji-completion

Conversation

@mmusil

@mmusil mmusil commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

… hang

Adds RestartPolicy: Always to both Selenium and Playwright sidecar containers to fix Job completion deadlock issue where UI containers would run forever after IQE tests complete.

Problem:

  • UI containers (Selenium/Playwright) run long-lived services (VNC + browser)
  • After main test container exits, Job waits for all containers to complete
  • Sidecar containers never exit on their own → Job hangs forever
  • CJI never completes, namespace cleanup never happens

Solution:

  • Use Kubernetes 1.29+ native sidecar support via RestartPolicy: Always
  • Kubernetes automatically terminates sidecar when main container exits
  • Job completes immediately after tests finish

Changes:

  1. controllers/cloud.redhat.com/providers/iqe/impl.go:

    • Add RestartPolicy: Always to createSeleniumContainer()
    • Add RestartPolicy: Always to createPlaywrightContainer()
  2. Update test assertions to verify RestartPolicy is set:

    • tests/kuttl/test-iqe-jobs-selenium/01-assert.yaml
    • tests/kuttl/test-iqe-jobs-playwright/01-assert.yaml

Compatibility:

  • Requires Kubernetes 1.29+ (production cluster is 1.34+)
  • Backward compatible - field ignored on older clusters

Comment thread controllers/cloud.redhat.com/providers/iqe/impl.go Outdated
containers = append(containers, *pwContainer)
}

j.Spec.Template.Spec.Containers = containers

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you think both pw and selenium should be InitContainers then only policy will apply?

… hang

Adds RestartPolicy: Always to both Selenium and Playwright sidecar containers
to fix Job completion deadlock issue where UI containers would run forever
after IQE tests complete.

**Problem:**
- UI containers (Selenium/Playwright) run long-lived services (VNC + browser)
- After main test container exits, Job waits for all containers to complete
- Sidecar containers never exit on their own → Job hangs forever
- CJI never completes, namespace cleanup never happens

**Solution:**
- Use Kubernetes 1.29+ native sidecar support via RestartPolicy: Always
- Kubernetes automatically terminates sidecar when main container exits
- Job completes immediately after tests finish

**Changes:**
1. controllers/cloud.redhat.com/providers/iqe/impl.go:
   - Add RestartPolicy: Always to createSeleniumContainer()
   - Add RestartPolicy: Always to createPlaywrightContainer()

2. Update test assertions to verify RestartPolicy is set:
   - tests/kuttl/test-iqe-jobs-selenium/01-assert.yaml
   - tests/kuttl/test-iqe-jobs-playwright/01-assert.yaml

**Compatibility:**
- Requires Kubernetes 1.29+ (production cluster is 1.34+)
- Backward compatible - field ignored on older clusters

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@mmusil mmusil force-pushed the iqe-cji-completion branch from 01c20be to b3d4ed0 Compare June 8, 2026 13:01
@bsquizz bsquizz merged commit f1335d6 into RedHatInsights:master Jun 8, 2026
7 of 8 checks passed
@mmusil mmusil deleted the iqe-cji-completion branch June 8, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants