Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-12034] Fix data races in pull_test.go
The pull test has tests which have instances of puller, that send each other messages via a common membership map. This map is populated at the creation of each instance via having each instance register itself into the map. The instance (which is test code) - spawns a goroutine at its creation, which schedules the production code and the latter accesses the said map. This makes it an unsafe memory access, and hence a data race occurs. I simply extractd the goroutine to its own start method, and made all tests first create the instances (which involves the write to the map) and only afterwards - start the goroutine, and thus - there is a happens before relation and the golang memory model is happy. FAB-12034 #done Change-Id: I976e9161873d1a7022b0263189af4cc2d3151001 Signed-off-by: yacovm <yacovm@il.ibm.com>
- Loading branch information
Showing
1 changed file
with
30 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters