-
Task
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
-
None
-
False
-
-
False
-
None
-
None
-
None
-
None
-
None
Related to: WINC-1585
Summary
Add optional WMCO operator log collection to Stage 3 (operator upgrade test 43832) of winc-upgrade job for debugging upgrade failures.
Background
When test 43832 (WMCO operator upgrade) fails, we need WMCO operator logs to determine if it's a product bug or automation issue. This feature allows collecting operator logs during the upgrade test when explicitly enabled by the user.
Implementation
1. Add Parameter (jobs/winc/winc-upgrade.groovy)
booleanParam\( 'COLLECT_WMCO_LOGS', false, ''' Collect WMCO Operator Logs Collect Windows Machine Config Operator logs during Stage 3 \(operator upgrade test\) and archive as artifacts. Enable this for debugging operator upgrade failures. ''' \)
2. Add Log Collection to Stage 3 Only (jobs/winc/winc-upgrade.jenkinsfile)
Stage 3: Run operator upgrade 43832
- Copy kubeconfig from Flexy artifacts
- Capture previous pod logs (if pod restarted during upgrade)
- Start background log collection with auto-retry on pod restart
- Stop collection in post
block
- Archive logs as wmco-operator-logs.txt
Stage 4: No log collection - Stage 4 can run large test suites (Smokerun, Windows_Containers) which would produce huge log files
3. Technical Details
- Default: false (disabled)
- Scope: Stage 3 only (test 43832)
- When enabled: Background oc logs -f with auto-reconnect loop
- Cleanup: Marker file removed in post block to stop background process
- Safety: Uses || true to prevent log failures from breaking tests
Benefits
✅ Targeted debugging - Logs for specific operator upgrade test
✅ User control - User decides when to enable
✅ Pod restart resilience - Auto-reconnects if operator restarts
✅ Non-blocking - Runs in background
✅ Optional - No overhead unless enabled
Acceptance Criteria
- COLLECT_WMCO_LOGS parameter added (default: false)
- Log collection implemented in Stage 3 only
- Stage 4 does NOT collect logs
- Background process handles pod restarts gracefully
- Cleanup runs in post { always }
block
- Logs archived as wmco-operator-logs.txt
- Documentation updated in winc-qe-docs
Testing Plan
- Run with COLLECT_WMCO_LOGS: false - verify no impact
- Run with COLLECT_WMCO_LOGS: true - verify logs collected from Stage 3 only
- Verify Stage 4 does not collect logs
- Verify no orphaned processes after job completes
Documentation
- Update docs/upgrade-testing.md in winc-qe-docs repo
- Add parameter description (Stage 3 only)
- Add artifact to "Job Artifacts" section