-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Quite often unit test failure showing "*** a different view with the same name is already registered" messages at many places. At the biggning of every metrics test, it tries to register respective metrics views(metrics data it want present), publish metrics and uniregister views. Uniregister view is important becuase for next test it dont need to hold the old metrics data. unregister() views were getting called using `defer` in table test for loop, just like for _, td := range tests { defer unregister() ....... } This were resulting unwanted execution behaviour for unregister() views function, which umtimately faling tests. Its better to unregister() views before start executing the tests. This patch fixes the behaviour by calling uniregister() views function at the end of loop. Fixes #1659
- Loading branch information
1 parent
c28df26
commit 21e0683
Showing
2 changed files
with
12 additions
and
7 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