Skip to content
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

[8.x](backport #7057) [flakiness] kubernetes_secrets provider unit tests #7155

Open
wants to merge 1 commit into
base: 8.x
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Mar 4, 2025

What does this PR do?

This PR introduces the following fixes and improvements:

  • Loosens Time Constraints in Unit Tests (needed for certain type of CI runners):

    • The TTLDelete value in test configurations was increased from 2s to 10s, ensuring tests have more leeway in processing cache expiration.
    • The waitForSignal value was adjusted from 1s to 2s to reduce test flakiness.
  • Adds Debug Logging for Fetch When Cache is Disabled: relevant comment

    • When the cache is disabled, fetching secrets from the API now logs the retrieved secret’s resource version for better visibility into API interactions.
  • Fixes a Typo in a Unit Test Name: relevant comment

    • The test case "key in secret not found" was incorrectly named and is now corrected to "key in secret found".

Why is it important?

Fixes a test failure (Test_Run/secret_no-update_and_no-signal) that caused CI flakiness

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • I have made corresponding changes to the default configuration files.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added an entry in ./changelog/fragments using the changelog tool.
  • I have added an integration test or an E2E test.

Disruptive User Impact

No expected impact on users. These changes are limited to debugging logs and test improvements.

How to test this PR locally

mage test:unit

Related issues


This is an automatic backport of pull request #7057 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner March 4, 2025 09:06
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Mar 4, 2025
@mergify mergify bot requested review from michalpristas and swiatekm and removed request for a team March 4, 2025 09:06
Copy link
Contributor Author

mergify bot commented Mar 4, 2025

Cherry-pick of 02fae02 has failed:

On branch mergify/bp/8.x/pr-7057
Your branch is up to date with 'origin/8.x'.

You are currently cherry-picking commit 02fae029b.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   internal/pkg/composable/providers/kubernetessecrets/kubernetes_secrets.go
	both modified:   internal/pkg/composable/providers/kubernetessecrets/kubernetes_secrets_test.go

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions bot added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team flaky-test Unstable or unreliable test cases. skip-changelog labels Mar 4, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@pkoutsovasilis
Copy link
Contributor

requires this one to be merged first

Copy link
Contributor Author

mergify bot commented Mar 4, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/8.x/pr-7057 upstream/mergify/bp/8.x/pr-7057
git merge upstream/8.x
git push upstream mergify/bp/8.x/pr-7057

* fix: loosen up redundant time constraints in unit-test

* fix: correct unit-test name

* fix: add debug logs for Fetch when cache is disabled

(cherry picked from commit 02fae02)

# Conflicts:
#	internal/pkg/composable/providers/kubernetessecrets/kubernetes_secrets.go
#	internal/pkg/composable/providers/kubernetessecrets/kubernetes_secrets_test.go
@pkoutsovasilis pkoutsovasilis force-pushed the mergify/bp/8.x/pr-7057 branch from 0f609d4 to 2bece6d Compare March 4, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request flaky-test Unstable or unreliable test cases. skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants