This repository has been archived by the owner on Oct 10, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it
Root cause of flaky plugin tests:
kapp-controller
pod has NOT been deleted yet.kapp-controller
actually restarts (the time oldkapp-controller
pod is replaced by new one). Which means the "make sure package API is available after kapp-controller restart" block insetUpPrivateRegistry
function can not guarantee that the packaging API is available AFTERkapp-controller
restartstestHelper
and tries to call package repository API, thekapp-controller
is still in progress of restarting. As a result, packaging API is not available and thus throw error:Evidence of this analysis:
In a pipeline run, the following logs are observed:
Note that the first
tanzu package repository list
is executed by the "make sure package API is available after kapp-controller restart" block. Which means that the packaging API is available in that check and thus the check passes. However, when the tests proceed, the packaging API becomes unavailable which fails the operations on package repository. This symptoms demonstrates that thekapp-controller
has not finished the restart yet while the corresponding check ("make sure package API ... restart") passes.Reasoning for the fix:
After switching order, the tests won't check the availability of packaging API right after deleting old
kapp-controller
pod. Instead it will first wait for registry pod to be up. So it gives time forkapp-controller
pods to be deleted before checking, which avoids the fact that the packaging API is available is because of oldkapp-controller
pods are still running. Testing details can be seen at theTesting done
section.Which issue(s) this PR fixes
Fixes #3324
Describe testing done for PR
Ran the pipeline multiple times and verified all of package plugin tests passed. Also observe the following log snippet which demonstrates that the "make sure package API is available after kapp-controller restart" test block is actually waiting for packaging API to become available after restart now:
Release note
Additional information
Special notes for your reviewer