-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-9146] fix TestCreateChainFromBlock data race
The test performs explicit viper configuration before creating each test and the gossip discovery service was using viper to retrieve the configuration at runtime from go routines it spawns. Since viper does not synchronize access to its maps, this resulted in a race. The race is avoided by creating fields on gossipDiscoveryImpl to hold the timeout values, setting them during construction, and referencing the fields at runtime instead of viper. TestCreateChainFromBlock was also modified to address issues that prevented execution with `go test -count n`. Change-Id: I57331d81be8c24f2ed83362f4551c14747596498 Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
- Loading branch information
Showing
2 changed files
with
27 additions
and
10 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
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