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

test: Enable race detector #15932

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

test: Enable race detector #15932

wants to merge 5 commits into from

Conversation

ericywl
Copy link
Contributor

@ericywl ericywl commented Feb 28, 2025

Motivation/summary

Enable race detector for tests, continuation of #13827.

How to test these changes

Run unit test, system test and CI.

Copy link
Contributor

mergify bot commented Feb 28, 2025

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

  • backport-7.17 is the label to automatically backport to the 7.17 branch.
  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • backport-9./d is the label to automatically backport to the 9./d branch. /d is the digit.
  • backport-8.x is the label to automatically backport to the 8.x branch.
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@ericywl ericywl mentioned this pull request Feb 28, 2025
2 tasks
@ericywl ericywl force-pushed the ci/test-race branch 2 times, most recently from c533712 to ac47e45 Compare February 28, 2025 04:44
The previous test was relying on docappender using exactly 1 bulk
indexer to fulfill the request. However, due to the low flush interval
setting of 1ms, there are some occassions where docappender uses 2
instead, resulting in failing unit test.

We could have simply increase the flush interval but I believe that
changing it makes it more consistent in the future.
@ericywl ericywl marked this pull request as ready for review February 28, 2025 07:14
@ericywl ericywl requested a review from a team as a code owner February 28, 2025 07:14
Comment on lines +493 to +499
monitoringtest.ExpectContainOtelMetricsFunc(t, reader, map[string]monitoringtest.AssertionFunc{
"elasticsearch.events.count": func(t *testing.T, actual any) bool { return actual.(int64) == 5 },
"elasticsearch.events.queued": func(t *testing.T, actual any) bool { return actual.(int64) == 5 },
"elasticsearch.bulk_requests.available": func(t *testing.T, actual any) bool {
// Available should be less than maxRequests since some will be used
return 0 < actual.(int64) && actual.(int64) < maxRequests
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[For reviewer] See commit a6f9618 for reasoning behind change.

@ericywl ericywl added the backport-skip Skip notification from the automated backport with mergify label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant