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.17](backport #41891) Invoke m.Run on TestMain and fix test flakiness #41908

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Dec 5, 2024

Proposed commit message

invoke m.Run on TestMain and reduce test flakiness

Some TestMain were not running any tests as they did not invoke m.Run. This change fixes that.

Also other tests were presenting some flakyness, therefore this change also attempts to fix the flakiness by setting really unique IDs for filestream tests and increasing a timeout for TestTranslateGUIDWithLDAP.

The following 4 packages were not running any test as the TestMain was not invoking m.Run() to actually run the test. The packages were:

  • filebeat/autodiscover/builder/hints
  • filebeat/processor/add_kubernetes_metadata
  • metricbeat/autodiscover/appender/kubernetes/token
  • metricbeat/autodiscover/builder/hints

Checklist

  • 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 change 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.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

  • N/A

How to test this PR locally

Run the test for the affected packages, the tests should run.

go test -v ./filebeat/autodiscover/builder/hints
go test -v ./filebeat/processor/add_kubernetes_metadata
go test -v ./metricbeat/autodiscover/appender/kubernetes/token
go test -v ./metricbeat/autodiscover/builder/hints

Before the fix:

❯ go test -v .
ok  	github.com/elastic/beats/v7/filebeat/autodiscover/builder/hints	0.530s

After the fix

❯ go test -v .
=== RUN   TestUnpackCopiesDefault
--- PASS: TestUnpackCopiesDefault (0.00s)
=== RUN   TestGenerateHints
--- PASS: TestGenerateHints (0.01s)
=== RUN   TestGenerateHintsWithPaths
--- PASS: TestGenerateHintsWithPaths (0.00s)
PASS
ok  	github.com/elastic/beats/v7/filebeat/autodiscover/builder/hints	0.172s

Related issues

  • N/A

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

Some TestMain were not running any tests as they did not invoke m.Run. This change fixes that.

Also other tests were presenting some flakyness, therefore this change also attempts to fix the flakiness by setting really unique IDs for filestream tests and increasing a timeout for TestTranslateGUIDWithLDAP.

(cherry picked from commit 83251ea)
@mergify mergify bot added the backport label Dec 5, 2024
@mergify mergify bot requested a review from a team as a code owner December 5, 2024 11:18
@mergify mergify bot requested review from belimawr and VihasMakwana and removed request for a team December 5, 2024 11:18
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 5, 2024
@botelastic
Copy link

botelastic bot commented Dec 5, 2024

This pull request doesn't have a Team:<team> label.

AndersonQ

This comment was marked as duplicate.

@AndersonQ AndersonQ enabled auto-merge (squash) December 5, 2024 11:23
@AndersonQ AndersonQ removed the request for review from belimawr December 6, 2024 09:26
@AndersonQ AndersonQ merged commit 2ad17aa into 8.17 Dec 6, 2024
47 of 49 checks passed
@AndersonQ AndersonQ deleted the mergify/bp/8.17/pr-41891 branch December 6, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants