提交 5812302e 编写于 作者: H helinwang 提交者: GitHub

Merge pull request #2856 from helinwang/race

Turn on race detector for all go tests
......@@ -338,7 +338,7 @@ function(go_test TARGET_NAME)
string(REPLACE "${PADDLE_GO_PATH}" "" CMAKE_CURRENT_SOURCE_REL_DIR ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(${TARGET_NAME} ALL DEPENDS go_vendor ${go_test_DEPS})
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND env GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} test
COMMAND env GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} test -race
-c -o "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}"
".${CMAKE_CURRENT_SOURCE_REL_DIR}"
WORKING_DIRECTORY "${PADDLE_IN_GOPATH}/go")
......
......@@ -164,7 +164,7 @@ func testClient(t *testing.T, c *client.Client) {
wg.Add(1)
go func(gs []pserver.Gradient) {
err = c.SendGrads(gs)
err := c.SendGrads(gs)
if err != nil {
t.Fatal(err)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册