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

Fix race detector errors in TestCoordinatorDiagnosticHooks #2830

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

faec
Copy link
Contributor

@faec faec commented Jun 9, 2023

TestCoordinatorDiagnosticHooks triggered the race detector because it accessed bare variables in its mocks from multiple goroutines. This fix makes the relevant conditions atomic and sets them from explicit callbacks instead. Followup from #2790.

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/fragments using the changelog tool
  • I have added an integration test or an E2E test

@mergify mergify bot assigned faec Jun 9, 2023
@mergify
Copy link
Contributor

mergify bot commented Jun 9, 2023

This pull request does not have a backport label. Could you fix it @faec? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip label Jun 9, 2023
@faec faec added bug Something isn't working Team:Elastic-Agent Label for the Agent team skip-changelog labels Jun 9, 2023
@faec faec marked this pull request as ready for review June 9, 2023 09:46
@faec faec requested a review from a team as a code owner June 9, 2023 09:46
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-06-09T09:28:05.912+0000

  • Duration: 21 min 46 sec

Test stats 🧪

Test Results
Failed 0
Passed 5983
Skipped 19
Total 6002

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.667% (74/75) 👍
Files 68.605% (177/258) 👍
Classes 67.423% (327/485) 👍
Methods 53.698% (1002/1866) 👍
Lines 39.577% (11471/28984) 👎 -0.028
Conditionals 100.0% (0/0) 💚

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@faec faec merged commit 0771842 into elastic:main Jun 12, 2023
@faec faec deleted the diagnostic-hooks-race branch June 12, 2023 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip bug Something isn't working skip-changelog Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants