forked from spiffe/spire
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix racy bundle client tests (spiffe#3575)
This change fixes test failures in the bundle client package. The failures were caused by non-goroutine safe manipulation of a map of configurations used as a config source and also an errant assertion that didn't account for production code behavior. To fix the non-goroutine safe config source, a new type was introduced that protected the underlying config map with a RW mutex. The errant assertion assumed that only one bundle refresh would be performed for a newly discovered trust domain. However, since the manual refresh operation ends up kicking off a goroutine that will also periodically refresh the bundle, under certain timing conditions, the bundle is refreshed twice. The assertion was updated to ensure that the bundle is updated at least once. Fixes: spiffe#2840,spiffe#3401 Signed-off-by: Andrew Harding <aharding@vmware.com>
- Loading branch information
Showing
4 changed files
with
71 additions
and
33 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
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