Skip to content

test(operator): cover the config-update reset clearing executors - #889

Open
nko-cpu wants to merge 4 commits into
mainfrom
test/776-config-reset-clears-jobs
Open

nko-cpu wants to merge 4 commits into
mainfrom
test/776-config-reset-clears-jobs

Conversation

@nko-cpu

@nko-cpu nko-cpu commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Part of #776. Follow-up requested by @lockwobr on #776 (from #788).

HandleConfigUpdates clears executors on every node it resets (deleteConfigUpdateExecutors), so the config stage re-runs on the new ConfigMap. No spec covered that wiring: dropping or moving the call would let a reset node finish on a Job still running the old data without failing a test.

Change

One envtest spec next to the other HandleConfigUpdates ones. It seeds an unfinished config Job on each of three nodes:

  • an erroring node at config, which opens the gate and is reset;
  • a node at interrupt (in progress), which is reset without erroring, so cleanup cannot depend on the gate-opening node;
  • a node still at apply, which the reset leaves alone.

It runs HandleConfigUpdates and asserts the first two Jobs are deleted and the third is kept. envtest runs no garbage collector, so a foreground delete shows as a deletionTimestamp.

Checked it fails when the deleteConfigUpdateExecutors call is removed.

Tested locally (from operator/)

  • make vet lint
  • go test ./internal/controller/ (the whole package, envtest 1.34.1)

The full make unit-tests target runs in CI.

🤖 Generated with Claude Code

nko-cpu and others added 4 commits October 21, 2026 13:41
HandleConfigUpdates calls deleteConfigUpdateExecutors for every node it
resets, but no spec exercised that wiring: dropping or moving the call would
let a reset node finish on a Job still running the old ConfigMap without
failing a test. Seed an unfinished config Job on a reset node and on a node
the reset leaves alone, and assert only the first is cleared.

Part of #776

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Noah Kontur <nkontur@nvidia.com>
… Job cleanup spec

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Noah Kontur <nkontur@nvidia.com>
…fig-reset Job spec

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Noah Kontur <nkontur@nvidia.com>
Signed-off-by: Noah Kontur <nkontur@nvidia.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 9811385 and ecb9d37.

📒 Files selected for processing: 1
  • operator/internal/controller/skyhook_controller_test.go

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 4 remain after this review.

📝 Walkthrough

Adds a test for HandleConfigUpdates. The test checks that unfinished config Jobs for erroring and interrupt-stage nodes are deleted or marked for deletion after a config update resets those nodes. It also checks that the Job for an apply-stage node remains.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related issues

Possibly related PRs

  • NVIDIA/nodewright#879: This PR adds an envtest for the same HandleConfigUpdates config-reset Job cleanup behavior.
Merge Risk: ⚪ Minimal · up to ecb9d

No merge-blocking issue is identified in this test change; it is ready for normal checks.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title names the change accurately: a test spec that covers the config-update reset clearing executors. The changeset adds one envtest spec for HandleConfigUpdates that checks config Jobs are delet…
Description check Passed The description states the purpose (cover the deleteConfigUpdateExecutors wiring in HandleConfigUpdates), the change (one envtest spec with three nodes at config, interrupt, and apply), the expected a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change accurately: a test spec that covers the config-update reset clearing executors. The changeset adds one envtest spec for HandleConfigUpdates that checks config Jobs are deleted on reset nodes and kept on non-reset nodes. The title is concise, specific, and follows the conventional test(scope) prefix. No search was needed for this check.

Full details: Description check

Explanation

The description states the purpose (cover the deleteConfigUpdateExecutors wiring in HandleConfigUpdates), the change (one envtest spec with three nodes at config, interrupt, and apply), the expected assertions, and the local test steps. It matches the changeset, so the check passes.

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@nko-cpu

nko-cpu commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

This replaces #879 (same branch, now pushed to NVIDIA/nodewright so CI runs without fork approval). The review there is addressed and the replies are on #879:

The threads there are left open for the reviewers to resolve.

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

Labels

component/operator Skyhook operator (controller-manager)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant