Closed Neirpyc closed 4 years ago
Thx for the change @Neirpyc . How about if we add the -race
flag to the CI scripts since that after merging this PR goblin will be race-free?
@marcosnils I'd rather suggest that we add a new test file with build flags // +build race
containing only test matching TestSomething_Race
so running go test
isn't any slower, go test -run=Race
says that there is no tests, and go test -race -run=Race
would run only a few specific test, to generate theses three race conditions.
I'd rather suggest that we add a new test file with build flags
// +build race
containing only test matchingTestSomething_Race
so runninggo test
isn't any slower,go test -run=Race
says that there is no tests, andgo test -race -run=Race
would run only a few specific test, to generate theses three race conditions.
I don't think that's necessary for now.. doesn't it? I believe we're over-optimizing at this point since goblin tests usually don't take that much time to run..
Yeah, I guess you're right.
Yet, this solution would give the choice to the user as running go test -race
would behave the same in both cases.
But it turns out that, as we have to compile two times if we run both tests separately, it's not worth it. Just do what you think is the best, and feel free to revert my second commit, I don't really care ^^.
Just do what you think is the best, and feel free to revert my second commit, I don't really care ^^.
:+1: I think I'll merge all tests for the moment and make go test -race ./...
run everything since goblin tests usually run very fast for now.
All right!
Another thing to do could be finding projects using Goblin, and running their tests with -race
to make sure there is no data race left in the Goblin's code which are not covered by Goblin's tests ^^
Another thing to do could be finding projects using Goblin, and running their tests with
-race
to make sure there is no data race left in the Goblin's code which are not covered by Goblin's tests ^^
That's a very good idea.. unfortunately.. I don't have the time for such quest ATM :(
List of changes
Why?
go test -race
on this package revealed multiple race conditions, which should be fixed by this PR.Now, the default tests of this package pass with the
-race
flag without issues.