Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help wanted: integration test fails due to controller-runtime issue #2263

Closed
Gekko0114 opened this issue Apr 4, 2023 · 1 comment
Closed

Comments

@Gekko0114
Copy link
Member

We are facing an issue with controller-runtime while creating integration-tests for scheduler-plugin. We would appreciate your comments on this.

In this PR, we have created integration test using mgr.Start(ctrl.SetupSignalHandler()). However, as another test also uses mgr.Start(ctrl.SetupSignalHandler()), we are encountering a panic error.

panic: close of closed channel
goroutine 9857 [running]:
sigs.k8s.io/controller-runtime/pkg/manager/signals.SetupSignalHandler()
/home/prow/go/src/sigs.k8s.io/scheduler-plugins/vendor/sigs.k8s.io/controller-runtime/pkg/manager/signals/signal.go:31 +0x25
sigs.k8s.io/scheduler-plugins/test/integration.TestPodGroupController.func1()
/home/prow/go/src/sigs.k8s.io/scheduler-plugins/test/integration/podgroup_controller_test.go:78 +0x32
created by sigs.k8s.io/scheduler-plugins/test/integration.TestPodGroupController
/home/prow/go/src/sigs.k8s.io/scheduler-plugins/test/integration/podgroup_controller_test.go:77 +0x3dd
FAIL sigs.k8s.io/scheduler-plugins/test/integration 356.228s

I think this is because ctrl.SetupSignalHandler is being executed twice in a single go test.
Could you suggest how we can implement integration test in such cases?

@Gekko0114
Copy link
Member Author

I've fixed my PR's issue, but I would appreciate any comments.

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

No branches or pull requests

1 participant