pingcap / tiflow

This repo maintains DM (a data migration platform) and TiCDC (change data capture for TiDB)
Apache License 2.0
416 stars 273 forks source link

engine/framework.Init meets race errors in the dependence testify #9619

Closed hicqu closed 1 month ago

hicqu commented 10 months ago

What did you do?

Upgrade to go-1.21, and run make engine_unit_test_in_verify_ci.

What did you expect to see?

No response

What did you see instead?

Data race is reported:

=== FAIL: engine/framework TestMasterCreateWorker (0.33s)

    testing.go:1465: race detected during execution of test

==================

WARNING: DATA RACE

Read at 0x00c00348b7b0 by goroutine 210:

  reflect.typedmemmove()

      /usr/local/go/src/runtime/mbarrier.go:193 +0x0

  reflect.packEface()

      /usr/local/go/src/reflect/value.go:135 +0xc5

  reflect.valueInterface()

      /usr/local/go/src/reflect/value.go:1520 +0x179

  reflect.Value.Interface()

      /usr/local/go/src/reflect/value.go:1490 +0xc8

  fmt.(*pp).printValue()

      /usr/local/go/src/fmt/print.go:769 +0x98

  fmt.(*pp).printValue()

      /usr/local/go/src/fmt/print.go:923 +0x134a

  fmt.(*pp).printArg()

      /usr/local/go/src/fmt/print.go:759 +0xda4

  fmt.(*pp).doPrintf()

      /usr/local/go/src/fmt/print.go:1176 +0x10b1

  fmt.Sprintf()

      /usr/local/go/src/fmt/print.go:239 +0x5c

  github.com/stretchr/testify/mock.Arguments.Diff()

      /go/pkg/mod/github.com/stretchr/testify@v1.8.4/mock/mock.go:926 +0x195

  github.com/stretchr/testify/mock.(*Mock).findExpectedCall()

      /go/pkg/mod/github.com/stretchr/testify@v1.8.4/mock/mock.go:365 +0x147

  github.com/stretchr/testify/mock.(*Mock).MethodCalled()

      /go/pkg/mod/github.com/stretchr/testify@v1.8.4/mock/mock.go:474 +0xac

  github.com/stretchr/testify/mock.(*Mock).Called()

      /go/pkg/mod/github.com/stretchr/testify@v1.8.4/mock/mock.go:464 +0x192

  github.com/pingcap/tiflow/engine/framework.(*testJobMasterImpl).InitImpl()

      /home/jenkins/agent/workspace/pingcap/tiflow/ghpr_verify/tiflow/engine/framework/base_jobmaster_test.go:61 +0x13d

  github.com/pingcap/tiflow/engine/framework.(*DefaultBaseJobMaster).Init()

      /home/jenkins/agent/workspace/pingcap/tiflow/ghpr_verify/tiflow/engine/framework/base_jobmaster.go:202 +0x1fe

  github.com/pingcap/tiflow/engine/framework.TestJobMasterExit()

      /home/jenkins/agent/workspace/pingcap/tiflow/ghpr_verify/tiflow/engine/framework/base_jobmaster_test.go:364 +0xcb2

  testing.tRunner()

      /usr/local/go/src/testing/testing.go:1595 +0x238

  testing.(*T).Run.func1()

      /usr/local/go/src/testing/testing.go:1648 +0x44

Versions of the cluster

master branch.

fubinzh commented 9 months ago

/severity moderate

asddongmen commented 1 month ago

close it since it is staled.