mirror of https://github.com/k3s-io/k3s
Merge pull request #55348 from jpbetz/fix-testcrd-race
Automatic merge from submit-queue (batch tested with PRs 55092, 55348, 55095, 55277, 55352). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix data race in TestCRD Fix this race: ``` ================== WARNING: DATA RACE Write at 0x00c42a845350 by goroutine 748: k8s.io/kubernetes/cmd/kube-apiserver/app/testing.TestCRD() cmd/kube-apiserver/app/testing/server_test.go:257 +0x15da testing.tRunner() /root/.cache/bazel/_bazel_root/e9f728bbd90b3fba632eb31b20e1dacd/external/go_sdk/src/testing/testing.go:746 +0x16c Previous write at 0x00c42a845350 by goroutine 481: k8s.io/kubernetes/cmd/kube-apiserver/app/testing.TestCRD.func2() cmd/kube-apiserver/app/testing/server_test.go:250 +0x241 ``` Related to #54095pull/6/head
commit
8a9d44913b
|
@ -247,7 +247,7 @@ func TestCRD(t *testing.T) {
|
|||
}
|
||||
createErr := make(chan error, 1)
|
||||
go func() {
|
||||
_, err = barComClient.Resource(&metav1.APIResource{Name: "foos", Namespaced: true}, "default").Create(unstructuredFoo)
|
||||
_, err := barComClient.Resource(&metav1.APIResource{Name: "foos", Namespaced: true}, "default").Create(unstructuredFoo)
|
||||
t.Logf("Foo instance create returned: %v", err)
|
||||
if err != nil {
|
||||
createErr <- err
|
||||
|
|
Loading…
Reference in New Issue