From d4676b67539419aced720772b13f556de8065fc1 Mon Sep 17 00:00:00 2001 From: Joe Finney Date: Wed, 13 Sep 2017 13:41:58 -0700 Subject: [PATCH] Enable go race detection for bazel tests. There are a couple tests that need to run without race detection enabled. See issue 39649 for details. --- build/root/.bazelrc | 3 +++ pkg/master/BUILD | 1 + staging/src/k8s.io/client-go/tools/cache/BUILD | 1 + 3 files changed, 5 insertions(+) diff --git a/build/root/.bazelrc b/build/root/.bazelrc index a7f69ce6f3a..a0eab2ccdcb 100644 --- a/build/root/.bazelrc +++ b/build/root/.bazelrc @@ -17,3 +17,6 @@ build --sandbox_fake_username # TODO(ixdy): Remove this default once rules_go is bumped. # Ref kubernetes/kubernetes#52677 build --incompatible_comprehension_variables_do_not_leak=false + +# Enable go race detection. +test --features=race diff --git a/pkg/master/BUILD b/pkg/master/BUILD index 8288c334650..00c0dc8fdf0 100644 --- a/pkg/master/BUILD +++ b/pkg/master/BUILD @@ -109,6 +109,7 @@ go_test( "master_openapi_test.go", "master_test.go", ], + features = ["-race"], library = ":go_default_library", deps = [ "//pkg/api:go_default_library", diff --git a/staging/src/k8s.io/client-go/tools/cache/BUILD b/staging/src/k8s.io/client-go/tools/cache/BUILD index 3531eba74c1..57e07760384 100644 --- a/staging/src/k8s.io/client-go/tools/cache/BUILD +++ b/staging/src/k8s.io/client-go/tools/cache/BUILD @@ -22,6 +22,7 @@ go_test( "store_test.go", "undelta_store_test.go", ], + features = ["-race"], library = ":go_default_library", deps = [ "//vendor/github.com/google/gofuzz:go_default_library",