diff --git a/cmake/generic.cmake b/cmake/generic.cmake index 48c054d17fa0b06998bd6b2a2a2b324afd2439e9..200e897c2aa57fdb7f1cd17a9ce3e8de3ce17a8a 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -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") diff --git a/go/pserver/client/client_test.go b/go/pserver/client/client_test.go index 27f4ff2380b3b5aa01485838eb4a876a8863d901..aab91556b4b91fab6de66322987eabe24f1b0f70 100644 --- a/go/pserver/client/client_test.go +++ b/go/pserver/client/client_test.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) }