-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Heartbeat] Fix race condition in scheduler tests #35728
Conversation
Pinging @elastic/uptime (Team:Uptime) |
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
@@ -231,15 +231,15 @@ func TestSchedTaskLimits(t *testing.T) { | |||
numJobs: 50, | |||
limit: math.MaxInt64, | |||
expect: func(events []int) { | |||
require.GreaterOrEqual(t, len(events), 50) | |||
require.GreaterOrEqual(t, len(events), 250) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels wrong, Even though the limit is maxed out, any reason why we are going far of the configured number of jobs? Probably I am missing something here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each task is generating 4 additional continuations, which it didn't originally account for
beats/heartbeat/scheduler/scheduler_test.go
Line 261 in c4398dc
tf := makeTasks(4, func() { |
(cherry picked from commit 0866673)
(cherry picked from commit 0866673) Co-authored-by: Emilio Alvarez Piñeiro <[email protected]>
What does this PR do?
Closes #35464.
Closes #35627.
Fixes race condition on scheduler unit tests.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.