sourcegraph / srclib

srclib is a polyglot code analysis library, built for hackability. It consists of language analysis toolchains (currently for Go and Java, with Python, JavaScript, and Ruby in beta) with a common output format, and a CLI tool for running the analysis.
https://srclib.org
Other
942 stars 62 forks source link

Fix counter data race #219

Closed slimsag closed 8 years ago

slimsag commented 8 years ago

This change fixes many data races present in the tests, where the actual method being tested runs several other goroutines, with each trying to touch a global counter variable. After this change, I am able to successfully run all tests with the race detector enabled.

Also enable the Go race detector in Travis, to help catch these in the future.

keegancsmith commented 8 years ago

Looks good to me! Also adding race detection CI ftw.

dmitshur commented 8 years ago

This was merged as https://github.com/sourcegraph/srclib/commit/ff4f690b157ce154af2f44018141c49b2d5b17df.