I am migrating to circleci2.0 and after successful build when tests are executed they are randomly failing with following error messages
/usr/local/go/pkg/tool/linux_amd64/link: signal: killed
/usr/local/go/pkg/tool/linux_amd64/link: flushing $WORK/b462/payment_step_svc.test: write $WORK/b462/svc.test: cannot allocate memory
I used the following config
jobs:
build:
docker:
- image: circleci/golang:latest
- image: rabbitmq:3.5.4
- image: redis
working_directory: /go/src/github.com/soniabhishek/taskrunner
environment:
GOOS: linux
GOARCH: amd64
GOPATH: /go
steps:
- checkout
- run:
name: Get dependencies
command: go get -t -d -v ./...
- run:
name: Build all
command: go build ./...
- run:
name: Test all
command: go test -v ./...
I have tried for many golang versions other than latest like (1.10.3).
Although I found the hack for this but I am not sure why is this happening, all my tests run when I use CGO_ENABLED=0
Would like to know why is this issue occurring and permanent solution for this