Skip to content

OCPBUGS-81507: UPSTREAM: <138159>: Tests: Call removeNodeTaint variadically instead of in a loop#2637

Open
jacobsee wants to merge 1 commit intoopenshift:masterfrom
jacobsee:remove-node-taint-timing-issue
Open

OCPBUGS-81507: UPSTREAM: <138159>: Tests: Call removeNodeTaint variadically instead of in a loop#2637
jacobsee wants to merge 1 commit intoopenshift:masterfrom
jacobsee:remove-node-taint-timing-issue

Conversation

@jacobsee
Copy link
Copy Markdown
Member

@jacobsee jacobsee commented Apr 1, 2026

What type of PR is this?

/kind flake

What this PR does / why we need it:

I believe there is a sneaky timing/caching issue here. When RemoveTaintsOffNode removes taints one at a time in a loop, each iteration reads the node from the API server cache, removes one taint, and patches. If the cache is stale for any iteration (still reflecting the state before the previous patch's watch event propagated) the patch sends the full stale list minus only the current taint, effectively re-adding the taint that was just removed in the prior step. Since the loop has already moved past that taint, it's never cleaned up. verifyThatTaintIsGone (previously called once per loop) doesn't catch this because it only checks whether the current taint was removed, not whether previously removed taints were re-introduced. The fix is to remove all taints in a single cycle instead of looping, which removeNodeTaint's variadic signature already supports.

Which issue(s) this PR is related to:

OCPBUGS-81507

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@openshift-ci-robot openshift-ci-robot added the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Apr 1, 2026
@openshift-ci openshift-ci Bot added the kind/flake Categorizes issue or PR as related to a flaky test. label Apr 1, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Apr 1, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@jacobsee: This pull request references Jira Issue OCPBUGS-81507, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

What type of PR is this?

/kind flake

What this PR does / why we need it:

I believe there is a sneaky timing/caching issue here. When RemoveTaintsOffNode removes taints one at a time in a loop, each iteration reads the node from the API server cache, removes one taint, and patches. If the cache is stale for any iteration (still reflecting the state before the previous patch's watch event propagated) the patch sends the full stale list minus only the current taint, effectively re-adding the taint that was just removed in the prior step. Since the loop has already moved past that taint, it's never cleaned up. verifyThatTaintIsGone (previously called once per loop) doesn't catch this because it only checks whether the current taint was removed, not whether previously removed taints were re-introduced. The fix is to remove all taints in a single cycle instead of looping, which removeNodeTaint's variadic signature already supports.

Which issue(s) this PR is related to:

OCPBUGS-81507

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Copy Markdown

@jacobsee: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5b929d9d-eb8b-40f7-afe2-26f19e892c5e

📥 Commits

Reviewing files that changed from the base of the PR and between fac1b62 and 8c97863.

📒 Files selected for processing (1)
  • test/e2e/framework/node/resource.go

Walkthrough

The RemoveTaintsOffNode function in a test framework was refactored to perform bulk taint removal instead of iterative individual removals. It now constructs a slice of pointers to the provided taints, calls removeNodeTaint once with all taint pointers, and subsequently verifies each taint is removed.

Changes

Cohort / File(s) Summary
Test Utility Refactoring
test/e2e/framework/node/resource.go
Refactored RemoveTaintsOffNode to use bulk removal of taints via a single removeNodeTaint call with a slice of pointers, followed by per-taint verification, replacing the previous iterative per-taint removal pattern.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from deads2k and p0lyn0mial April 1, 2026 22:06
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 1, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jacobsee

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

The pull request process is described 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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 1, 2026
@jacobsee jacobsee force-pushed the remove-node-taint-timing-issue branch from 89898f8 to fac1b62 Compare April 1, 2026 22:18
@openshift-ci-robot
Copy link
Copy Markdown

@jacobsee: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

I believe there is a sneaky timing/caching issue here. When RemoveTaintsOffNode removes taints one at a time in a loop, each iteration reads the node from the API server cache, removes one taint, and patches. If the cache is stale for any iteration (still reflecting the state before the previous patch's watch event propagated) the patch sends the full stale list minus only the current taint, effectively re-adding the taint that was just removed in the prior step. Since the loop has already moved past that taint, it's never cleaned up. verifyThatTaintIsGone (previously called once per loop) doesn't catch this because it only checks whether the current taint was removed, not whether previously removed taints were re-introduced. The fix is to remove all taints in a single cycle instead of looping, which removeNodeTaint's variadic signature already supports.
@jacobsee jacobsee force-pushed the remove-node-taint-timing-issue branch from fac1b62 to 8c97863 Compare April 1, 2026 22:41
@openshift-ci-robot
Copy link
Copy Markdown

@jacobsee: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 1, 2026

@jacobsee: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/verify-commits fac1b62 link true /test verify-commits

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@jacobsee
Copy link
Copy Markdown
Member Author

jacobsee commented Apr 1, 2026

/payload-aggregate periodic-ci-openshift-release-master-nightly-4.21-e2e-azure-ovn-serial-runc 10

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 1, 2026

@jacobsee: trigger 0 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

@jacobsee
Copy link
Copy Markdown
Member Author

jacobsee commented Apr 2, 2026

/payload-aggregate periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn-serial 10

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 2, 2026

@jacobsee: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn-serial

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/0e67d300-2e2c-11f1-94ff-54087b0b4ae0-0

@jacobsee
Copy link
Copy Markdown
Member Author

jacobsee commented Apr 2, 2026

/payload-aggregate periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn-serial 10

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 2, 2026

@jacobsee: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn-serial

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/b357aa00-2ed3-11f1-8d9f-ed430f46d238-0

@jacobsee
Copy link
Copy Markdown
Member Author

jacobsee commented Apr 3, 2026

/payload-aggregate periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn-serial 10

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 3, 2026

@jacobsee: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn-serial

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/fc87ec90-2f0e-11f1-902a-f57c7b79fa99-0

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/flake Categorizes issue or PR as related to a flaky test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants