From 8131831d02b84045695b3974eb0628adf173ffaf Mon Sep 17 00:00:00 2001 From: Peter Bacsko Date: Wed, 17 Apr 2024 01:16:58 +0200 Subject: [PATCH] [YUNIKORN-2563] [shim] Enable deadlock detection during unit tests --- Makefile | 3 +++ go.mod | 4 ++-- go.sum | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e566f0eed..0c68f105b 100644 --- a/Makefile +++ b/Makefile @@ -583,6 +583,9 @@ $(RELEASE_BIN_DIR)/$(TEST_SERVER_BINARY): go.mod go.sum $(shell find pkg) # Run the tests after building .PHONY: test +test: export DEADLOCK_DETECTION_ENABLED = true +test: export DEADLOCK_TIMEOUT_SECONDS = 10 +test: export DEADLOCK_EXIT = true test: @echo "running unit tests" @mkdir -p "$(OUTPUT)" diff --git a/go.mod b/go.mod index b56771959..05e485cce 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ module github.com/apache/yunikorn-k8shim go 1.21 require ( - github.com/apache/yunikorn-core v0.0.0-20240405153113-5758d7ac3c85 + github.com/apache/yunikorn-core v0.0.0-20240417112924-e89458fa3cc4 github.com/apache/yunikorn-scheduler-interface v0.0.0-20240402211642-e7421a4261fd github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 @@ -29,6 +29,7 @@ require ( github.com/onsi/ginkgo/v2 v2.15.0 github.com/onsi/gomega v1.30.0 github.com/prometheus/client_golang v1.18.0 + github.com/sasha-s/go-deadlock v0.3.1 go.uber.org/zap v1.26.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 v3.5.1 @@ -103,7 +104,6 @@ require ( github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stoewer/go-strcase v1.2.0 // indirect diff --git a/go.sum b/go.sum index fad0a064a..b3ebb0299 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cq github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= -github.com/apache/yunikorn-core v0.0.0-20240405153113-5758d7ac3c85 h1:bPbrFZc+qgsepdJXclpgwGLYEPeKSL6W69i+RUjPc6o= -github.com/apache/yunikorn-core v0.0.0-20240405153113-5758d7ac3c85/go.mod h1:DnScYvh1qQ7v89tebVH43LcuEDoUXLy2wm8aE4Co75Y= +github.com/apache/yunikorn-core v0.0.0-20240417112924-e89458fa3cc4 h1:nnZKWKycGVcIBVmQsIM4MHO0TwLfZ6wS09dMI4Tvl7o= +github.com/apache/yunikorn-core v0.0.0-20240417112924-e89458fa3cc4/go.mod h1:DnScYvh1qQ7v89tebVH43LcuEDoUXLy2wm8aE4Co75Y= github.com/apache/yunikorn-scheduler-interface v0.0.0-20240402211642-e7421a4261fd h1:uNOijHkCotZLUZ+A85NSftEJGfP50Opf7ms6Daj6pco= github.com/apache/yunikorn-scheduler-interface v0.0.0-20240402211642-e7421a4261fd/go.mod h1:0f4l3ManMROX60xU7GbhejCEYYyMksH275oY2xIVkbM= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=