Enable race detector for unit tests (#2085)

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2021-07-23 13:24:10 +05:30
committed by GitHub
parent b273d10388
commit 7cd877698b
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ echo "" > coverage.txt
# The executor unit test only works with NodePort-type services for
# now. So disable it for our travis ci tests except some partial tests.
for d in $(go list ./... | grep -v '/vendor/' | grep -v 'examples/go' | grep -v executor | grep -v 'benchmark') github.com/fission/fission/pkg/executor/util; do
go test -v -coverprofile=profile.out -covermode=atomic $d
go test -race -v -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
@@ -319,7 +319,12 @@ func pollAzureQueueSubscription(conn AzureStorageConnection, sub *AzureQueueSubs
}
func invokeTriggeredFunction(conn AzureStorageConnection, sub *AzureQueueSubscription, message AzureMessage) {
defer message.Delete(nil) //nolint: errCheck
defer func() {
err := message.Delete(nil)
if err != nil {
conn.logger.Error(err.Error())
}
}()
conn.logger.Info("making HTTP request to invoke function", zap.String("function_url", sub.functionURL))