forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 1
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 test data. unregister() views were getting called using `defer` in table test for loop, just like for _, td := range tests { defer unregister() ....... } This defer actually gets execute after completion of test function rather than for each loop. This were resulting unwanted execution behaviour for unregister() views function, which umtimately faling tests. This patch fixes the behaviour by calling uniregister() views function at the end of loop. Fixes tektoncd#1659
- Loading branch information
Showing
2 changed files
with
9 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