From f08100022c777982b292466b8612230d4a3c6731 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Wed, 27 Mar 2019 20:30:54 +0100 Subject: [PATCH 1/2] misc: require Go 1.12 License: MIT Signed-off-by: Jakub Sztandera --- .circleci/config.yml | 2 +- go.mod | 2 ++ mk/golang.mk | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 20b6aceedaf..9a09195a7ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,7 +33,7 @@ defaults: &defaults TRAVIS: 1 docker: - - image: circleci/golang:1.11 + - image: circleci/golang:1.12 jobs: gotest: diff --git a/go.mod b/go.mod index b2d872bec7f..518d70aad39 100644 --- a/go.mod +++ b/go.mod @@ -115,3 +115,5 @@ require ( gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect gotest.tools/gotestsum v0.3.3 ) + +go 1.12 diff --git a/mk/golang.mk b/mk/golang.mk index bbdebbc2ee7..683757c0b30 100644 --- a/mk/golang.mk +++ b/mk/golang.mk @@ -1,5 +1,5 @@ # golang utilities -GO_MIN_VERSION = 1.11.4 +GO_MIN_VERSION = 1.12 export GO111MODULE=on From 5d19b58911638155cdb28d74a84ba8a93b7f6770 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Thu, 4 Apr 2019 20:10:44 +0200 Subject: [PATCH 2/2] coverage: fix race of signal vs start of a process License: MIT Signed-off-by: Jakub Sztandera --- coverage/main/main.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/coverage/main/main.go b/coverage/main/main.go index ba5d473e342..be616e08d72 100644 --- a/coverage/main/main.go +++ b/coverage/main/main.go @@ -43,15 +43,26 @@ func main() { Pdeathsig: syscall.SIGTERM, } - sig := make(chan os.Signal, 1) + sig := make(chan os.Signal, 10) + start := make(chan struct{}) go func() { + <-start for { p.Process.Signal(<-sig) } }() + signal.Notify(sig, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM) - err = p.Run() + err = p.Start() + if err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } + + close(start) + + err = p.Wait() if err != nil { fmt.Println(err.Error()) os.Exit(1)