From 10f7e1c6f3046873b05f118f48cb3daef5feee14 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Fri, 1 Nov 2019 13:04:32 -0700 Subject: Add race condition detection 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 --- src/k8splugin/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k8splugin/Makefile b/src/k8splugin/Makefile index 7d41158c..77196afa 100644 --- a/src/k8splugin/Makefile +++ b/src/k8splugin/Makefile @@ -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 -- cgit 1.2.3-korg