Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

test: rename race.go to race_test.go #5869

Merged
merged 1 commit into from
Dec 16, 2022
Merged

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Dec 16, 2022

race.go has the following build constraints:

//go:build race
// +build race

and sets the package global variable raceMode to true.

The way things are currently, I get a build failure when I try to run all tests under grpc with --config==gotsan:

easwars@minetop: google3$ blaze test third_party/golang/grpc/... --config=gotsan
...
third_party/golang/grpc/test/race.go:24:2: undefined: raceMode

I don't quite understand why I see this failure, because if I do blaze test third_party/golang/grpc/test:test_test --config=gotsan, that works.

What I do understand though is that the we end up having two BUILD targets for the test package, test and test_test. The former contains files in this package which don't have an _test.go suffix. And renaming race.go to race_test.go puts in the test_test package and things work fine with this approach.

Also, race.go sets the raceMode variable which is defined in end2end_test.go. So, it makes sense for the former to be part of the test_test package.

RELEASE NOTES: none

@easwars easwars requested a review from dfawley December 16, 2022 00:47
@easwars easwars added this to the 1.52 Release milestone Dec 16, 2022
@dfawley dfawley assigned easwars and unassigned dfawley Dec 16, 2022
@easwars easwars merged commit a0e8eb9 into grpc:master Dec 16, 2022
@easwars easwars deleted the race_test branch December 16, 2022 22:40
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants