Skip to content

[RayService] Fix broken build: use events.NewFakeRecorder in unit test - #5087

Open
KunWuLuan wants to merge 1 commit into
ray-project:masterfrom
KunWuLuan:fix/rayservice-unit-test-record-import
Open

[RayService] Fix broken build: use events.NewFakeRecorder in unit test#5087
KunWuLuan wants to merge 1 commit into
ray-project:masterfrom
KunWuLuan:fix/rayservice-unit-test-record-import

Conversation

@KunWuLuan

Copy link
Copy Markdown
Contributor

Why

master currently does not compile. golangci-lint (pre-commit) fails on every open PR with:

ray-operator/controllers/ray/rayservice_controller_unit_test.go:2637:13: undefined: record (typecheck)

Root cause

A semantic merge conflict between two independently-green PRs:

Merged together, record is undefined, so the test package fails to typecheck. Each PR passed CI on its own base; the combination on master does not compile.

Fix

Switch the single stray call to events.NewFakeRecorder(10), matching every other recorder in the file (e.g. lines 476, 909). One line, no import changes.

Verification

cd ray-operator && go vet ./controllers/ray/   # passes (previously: undefined: record)

rayservice_controller_unit_test.go:2637 called record.NewFakeRecorder, but
the file no longer imports k8s.io/client-go/tools/record (it was migrated to
k8s.io/client-go/tools/events). This is a semantic merge conflict between the
events migration and ray-project#4894, leaving master non-compiling (undefined: record).

Switch to events.NewFakeRecorder(10), matching every other recorder in the file.
@machichima

Copy link
Copy Markdown
Collaborator

I think this is duplicated with #5084

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.

2 participants