-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit tests are broken #1659
Labels
area/testing
Issues or PRs related to testing
kind/flake
Categorizes issue or PR as related to a flakey test
Comments
/assign @hrishin |
vdemeester
added
area/testing
Issues or PRs related to testing
kind/flake
Categorizes issue or PR as related to a flakey test
labels
Dec 3, 2019
hrishin
added a commit
to hrishin/tekton-pipeline
that referenced
this issue
Dec 11, 2019
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
This fix hopefully should resolve failing tests for #1709 |
hrishin
added a commit
to hrishin/tekton-pipeline
that referenced
this issue
Dec 11, 2019
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 tektoncd#1659
tekton-robot
pushed a commit
that referenced
this issue
Dec 11, 2019
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/testing
Issues or PRs related to testing
kind/flake
Categorizes issue or PR as related to a flakey test
Expected Behavior
Unit tests pass in CI and in (nightly) releases.
Actual Behavior
Unit tests pass in CI but fail in releases:
Steps to Reproduce the Problem
Additional Info
The text was updated successfully, but these errors were encountered: