Skip to content

TestTaintsUpdated: Drop errChan, it's usefull only during the startup#585

Closed
ingvagabund wants to merge 1 commit intokubernetes-sigs:masterfrom
ingvagabund:TestTaintsUpdated-drop-errChan
Closed

TestTaintsUpdated: Drop errChan, it's usefull only during the startup#585
ingvagabund wants to merge 1 commit intokubernetes-sigs:masterfrom
ingvagabund:TestTaintsUpdated-drop-errChan

Conversation

@ingvagabund
Copy link
Copy Markdown
Contributor

Otherwise, one can get:

panic: send on closed channel

goroutine 76 [running]:
sigs.k8s.io/descheduler/pkg/descheduler.TestTaintsUpdated.func1(0x2d1b390, 0xc000126010, 0xc0000d8c60, 0xc00038fbd0, 0xc000111320, 0xc000239380)
	/home/travis/gopath/src/github.com/openshift/descheduler/_output/local/go/src/sigs.k8s.io/descheduler/pkg/descheduler/descheduler_test.go:51 +0xbe
created by sigs.k8s.io/descheduler/pkg/descheduler.TestTaintsUpdated
	/home/travis/gopath/src/github.com/openshift/descheduler/_output/local/go/src/sigs.k8s.io/descheduler/pkg/descheduler/descheduler_test.go:49 +0x6db
FAIL	sigs.k8s.io/descheduler/pkg/descheduler	0.845s

Otherwise, one can get:
```
panic: send on closed channel

goroutine 76 [running]:
sigs.k8s.io/descheduler/pkg/descheduler.TestTaintsUpdated.func1(0x2d1b390, 0xc000126010, 0xc0000d8c60, 0xc00038fbd0, 0xc000111320, 0xc000239380)
	/home/travis/gopath/src/github.com/openshift/descheduler/_output/local/go/src/sigs.k8s.io/descheduler/pkg/descheduler/descheduler_test.go:51 +0xbe
created by sigs.k8s.io/descheduler/pkg/descheduler.TestTaintsUpdated
	/home/travis/gopath/src/github.com/openshift/descheduler/_output/local/go/src/sigs.k8s.io/descheduler/pkg/descheduler/descheduler_test.go:49 +0x6db
FAIL	sigs.k8s.io/descheduler/pkg/descheduler	0.845s
```
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 9, 2021
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ingvagabund

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 9, 2021

go func() {
err := RunDeschedulerStrategies(ctx, rs, dp, "v1beta1", stopChannel)
errChan <- err
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should remove this pattern entirely (from when it was added in #568)

Rather, I think the panic you're seeing could be fixed by moving the nil check to here from L55, so we're not always sending nil over this channel. wdyt?

@ingvagabund ingvagabund closed this Jun 9, 2021
@ingvagabund ingvagabund deleted the TestTaintsUpdated-drop-errChan branch June 9, 2021 17:03
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants