Skip to content

Fix AfterEach in ingress manifest tests to restore override first#4120

Open
Davo911 wants to merge 1 commit into
kubevirt:mainfrom
Davo911:fix-ingress-config-test-override-wipe
Open

Fix AfterEach in ingress manifest tests to restore override first#4120
Davo911 wants to merge 1 commit into
kubevirt:mainfrom
Davo911:fix-ingress-config-test-override-wipe

Conversation

@Davo911
Copy link
Copy Markdown
Member

@Davo911 Davo911 commented May 8, 2026

What this PR does / why we need it:
Fix a bug in the cdiconfig_test.go ingress config test BeforeEach that permanently wipes uploadProxyURLOverride when an override is set externally (e.g. via UPLOAD_PROXY_URL_OVERRIDE in CI see s390x rehearsal job in kubevirt/project-infra#4832).

The CDI ingress config tests and CDI ingress config tests, using manifests check the route-based URL before saving the existing override. When an override like :6005 is set, status.uploadProxyURL reflects that override and doesn't match the route prefix, so the Eventually times out. Since origUploadProxyOverride was never saved, the AfterEach restores nil — wiping the override for all subsequent tests.

This was discovered while debugging upload proxy connection timeouts in the s390x e2e Prow job, where all upload tests failed with dial tcp <ip>:443: connect: connection timed out because the :6005 override was silently wiped mid-run.

The fix

  • reorders BeforeEach to save+clear the override before the route URL check, matching the CDI route config tests which already do this correctly.
  • Moves the manifest cleanup in AfterEach (for the "using manifests" variant) after the override restore, so a manifest delete failure doesn't prevent restoration.

Validated by running focused cdiconfig + upload tests on both main (override wiped to nil after ingress tests) and this branch (override preserved at :6005).

/cc @awels @dollierp

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

NONE

The "using manifests" AfterEach asserted on manifest cleanup before
restoring the uploadProxyURLOverride, so any manifest delete failure
would prevent the override from being restored.

Move the override restore before the manifest delete, and guard the
delete with a nil check on manifestFile.

Fix ingress config test BeforeEach wiping uploadProxyURLOverride

The ingress config tests checked the route URL before saving the
override, so when the Eventually timed out the AfterEach restored
a nil value, permanently wiping the override for all subsequent tests.

Reorder to save+clear the override first, matching the route config
tests which already do this correctly.
Signed-off-by: Thomas-David Griedel griedel911@gmail.com
Co-Authored-By: Cursor Agent <cursoragent@cursor.com>
@kubevirt-bot kubevirt-bot requested review from awels and dollierp May 8, 2026 18:58
@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels May 8, 2026
@kubevirt-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mhenriks for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 49.571% (-0.007%) from 49.578% — Davo911:fix-ingress-config-test-override-wipe into kubevirt:main

@Davo911
Copy link
Copy Markdown
Member Author

Davo911 commented May 8, 2026

/test pull-containerized-data-importer-non-csi-hpp

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

Labels

dco-signoff: yes Indicates the PR's author has DCO signed all their commits. release-note-none Denotes a PR that doesn't merit a release note. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants