pulsarctl icon indicating copy to clipboard operation
pulsarctl copied to clipboard

Enable the race detector in the test environment

Open timmyyuan opened this issue 3 years ago • 6 comments

https://go.dev/doc/articles/race_detector

timmyyuan avatar Mar 14 '22 11:03 timmyyuan

@timmyyuan Please fix the CI.

go test: -race requires cgo; enable cgo by setting CGO_ENABLED=1

nodece avatar Mar 15 '22 02:03 nodece

@nodece Does pulsarctl must be built with CGO_ENABLED=0 ?

timmyyuan avatar Mar 17 '22 07:03 timmyyuan

@nodece Does pulsarctl must be built with CGO_ENABLED=0 ?

No, we also can set the CGO_ENABLED=1, but we need to install the GCC in the docker image.

The pulsar image didn't include the gcc.

nodece avatar Mar 17 '22 07:03 nodece

The CI has been passed, but we need to add check the gcc command in the docker image, if the gcc command not found, we need to install the gcc.

nodece avatar Mar 17 '22 07:03 nodece

@nodece go test -race is only called in the test environment, do we have to check gcc since the CI passed (which means a C/C++ compiler is obviously available) ? Do you mean we'd better keep the same CGO_ENABLED value in the test and production environments ?

timmyyuan avatar Mar 20 '22 04:03 timmyyuan

go test -race is only called in the test environment, do we have to check gcc since the CI passed (which means a C/C++ compiler is obviously available)

Yes, you are right.

Do you mean we'd better keep the same CGO_ENABLED value in the test and production environments?

I think everything is OK.

@timmyyuan Currently, we are using the Pulsar [email protected], so this CI has been passed, but the Pulsar [email protected] don't include the gcc, so we need to install the gcc command.

nodece avatar Mar 20 '22 11:03 nodece