Skip to content

runtime/race: consider adding IsEnabled const #7706

@dvyukov

Description

@dvyukov
Sometimes it's required to temporary disable tests, reduce number of iterations or scale
timeouts under race detector.

We use this extensively for C++ race detector and memory checker in large projects that
develop quickly (e.g. Chromium).

Currently it's quite difficult to do, you need to add 2 new files (+build race/!race).
When the test is fixed, you need to delete the files consequently.

See e.g.:
https://golang.org/cl/44180043/diff/60001/src/pkg/runtime/pprof/pprof_test.go
where we have to completely disable the test, while we want to do it only under race
detector.

The proposal is to add something like
package race
const IsEnabled = true/false

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions