Add race condition detection 68/97868/3
authorKiran Kamineni <kiran.k.kamineni@intel.com>
Fri, 1 Nov 2019 20:04:32 +0000 (13:04 -0700)
committerKiran Kamineni <kiran.k.kamineni@intel.com>
Thu, 7 Nov 2019 01:01:23 +0000 (17:01 -0800)
Add the -race flag to detect any race conditions
in the k8splugin code
It is enabled only for tests right now because of performance
impact on builds.

Issue-ID: MULTICLOUD-870
Change-Id: I53a90df39d2d8b51cbdb6c320f2247721ed98a07
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
src/k8splugin/Makefile

index 7d41158..77196af 100644 (file)
@@ -25,8 +25,8 @@ deploy: build
 
 .PHONY: test
 test: clean
-       @go build -buildmode=plugin -o ./mock_files/mock_plugins/mockplugin.so ./mock_files/mock_plugins/mockplugin.go
-       @go test -v ./...
+       @go build -race -buildmode=plugin -o ./mock_files/mock_plugins/mockplugin.so ./mock_files/mock_plugins/mockplugin.go
+       @go test -race ./...
 
 format:
        @go fmt ./...
@@ -40,5 +40,5 @@ clean:
 
 .PHONY: cover
 cover:
-       @go test ./... -coverprofile=coverage.out
+       @go test -race ./... -coverprofile=coverage.out
        @go tool cover -html=coverage.out -o coverage.html