🌱 Prevent duplicate log watchers in E2E tests#3024
🌱 Prevent duplicate log watchers in E2E tests#3024lentzi90 wants to merge 1 commit intometal3-io:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/test metal3-bmo-e2e-test-optional-pull |
|
/hold |
b292e97 to
2dddfc9
Compare
|
Now the logs look correct |
|
I forgot to run upgrade tests... |
2dddfc9 to
9bc7756
Compare
|
/test metal3-bmo-e2e-test-optional-pull |
|
Log duplication fixes are working. There are more duplications still that we cannot fix here though. See #2927 (comment). |
|
/hold cancel |
9bc7756 to
6fa012a
Compare
|
/test metal3-bmo-e2e-test-optional-pull |
6fa012a to
72f2906
Compare
|
/test metal3-bmo-e2e-test-optional-pull |
| @@ -621,13 +669,15 @@ func BuildAndApplyKustomization(ctx context.Context, input *BuildAndApplyKustomi | |||
| } | |||
There was a problem hiding this comment.
I think this can be make simpler if we just return if WaitForDeploymentsAvailable fails,
and call WatchDeploymentLogsByName only when Deployment is successful.
What do you think?
There was a problem hiding this comment.
Hmm not sure I understand. I think WaitForDeploymentAvailable already fails the test if it fails, so in that case we do not continue.
The thing I am trying to fix here is when we use FlakeAttempts, here:
There was a problem hiding this comment.
Does FlakeAttempt always run twice even if first run is successful?
I think it would be better to use Eventually here. In Eventually as soon as there is success it will not try again.
There was a problem hiding this comment.
No it should only run 2 times if the first fails. Hmm maybe I could remove this actually. I think we added it when IPA downloader was very flaky. It may not be needed anymore.
/hold
Let me check this
There was a problem hiding this comment.
Looks like we do need FlakeAttempts still. I think it is not really flaky, rather the first fails every time. Maybe we could clean that up in some other way, but for now I think this log watcher fix is ok.
/hold cancel
We sometimes use BuildAndApplyKustomization multiple times, e.g. inside FlakeAttempt. This is an issue for the log watchers, since we create a new watcher each time. Each watcher writes logs to the files so we end up with the logs duplicated. To fix this, keep track of which watchers we have and skip setting up duplicates. Additionally, clean up the watchers after the test is done, to avoid leaking and spamming. Signed-off-by: Lennart Jern <lennart.jern@est.tech>
72f2906 to
060947b
Compare
|
/test metal3-bmo-e2e-test-optional-pull |
|
Ok it looks like we still need the FlakeAttempts. From what I understand we need it at least when applying BMO, because we create namespaces together with resources in the namespaces, so things fail the first time because the namespaces are missing. |
060947b to
72e2b10
Compare
|
/test metal3-bmo-e2e-test-optional-pull |
|
/ok-to-test |
|
/hold |
What this PR does / why we need it:
We sometimes use BuildAndApplyKustomization multiple times, e.g. inside
FlakeAttempt. This is an issue for the log watchers, since we create a
new watcher each time. Each watcher writes logs to the files so we end
up with the logs duplicated. To fix this, keep track of which watchers
we have and skip setting up duplicates. Additionally, clean up the
watchers after the test is done, to avoid leaking and spamming.
I think we use FlakeAttempts only during upgrade tests, so don't expect to see a difference in the normal tests.
Part of #2927
Checklist: