anz-bank / sysl-go

Communication library used by SYSL-generated code written in Go.
Apache License 2.0
10 stars 14 forks source link

non-deterministic test failure for test TestValidRequestResponse #217

Open anz-rfc opened 4 years ago

anz-rfc commented 4 years ago

Description

non-deterministic test failure for test TestValidRequestResponse

Steps to Reproduce

  1. run make all

Expected behavior

running make all from clean slate has same outcome

Actual behavior

sometimes running make all from a clean slate fails with

ok      github.com/anz-bank/sysl-go/codegen/tests/simple    0.036s  coverage: 27.3% of statements
--- FAIL: TestValidRequestResponse (0.00s)
    simplegrpc_test.go:78: 
            Error Trace:    simplegrpc_test.go:78
                                        simplegrpc_test.go:115
            Error:          Received unexpected error:
                            rpc error: code = Unimplemented desc = unknown service simplepb.SimpleGrpc
            Test:           TestValidRequestResponse
FAIL
coverage: 58.8% of statements

Your Environment

dockerised debian dev environment:

Define new file devenv.Dockerfile inside checkout of sysl-go repo:

FROM golang:1.14-stretch

WORKDIR /temp-deps/sysl
RUN curl -LJO https://github.com/anz-bank/sysl/releases/download/v0.207.0/sysl_0.207.0_linux-amd64.tar.gz && tar -xvf sysl_0.207.0_linux-amd64.tar.gz && mv sysl /bin/sysl

WORKDIR /temp-deps/arrai
RUN curl -LJO https://github.com/arr-ai/arrai/releases/download/v0.171.0/arrai_v0.171.0_linux-amd64.tar.gz && tar -xvf arrai_v0.171.0_linux-amd64.tar.gz && mv arrai /bin/arrai

WORKDIR /temp-deps/golangci-lint
RUN curl -LJO https://github.com/golangci/golangci-lint/releases/download/v1.29.0/golangci-lint-1.29.0-linux-amd64.tar.gz && tar -xvf golangci-lint-1.29.0-linux-amd64.tar.gz && mv golangci-lint-1.29.0-linux-amd64/golangci-lint /bin/golangci-lint

RUN go get golang.org/x/tools/cmd/goimports

RUN arrai info

COPY . /sysl-go
WORKDIR /sysl-go
RUN make -d all

then run it with docker:

docker build -f devenv.Dockerfile -t sysl-go-devenv:hack .

n.b. arrai info output is

Version    : v0.171.0
Git commit : 4e544ebba43503cb12e6d1a9bc2bfed01291b177
Date       : 2020-09-06T23:54:08Z
OS/arch    : linux/amd64
Go version : go1.14.8 linux/amd64