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] Fix flaky test in negative_acks_tracker_test.go #1017

Merged
merged 1 commit into from
May 12, 2023

Conversation

RobertIndie
Copy link
Member

Fixes #1016

Motivation

The test for negative ack trackers needs to wait sometime to close the message channel. We use this interval time to assert that the negativeAckTracker can trigger the redelivering with the correct time interval. But we can't assert this interval very precisely due to the concurrent execution. Currently, we reserve only one millisecond for this concurrent execution:

if nackBackoffPolicy == nil {
time.Sleep(testNackDelay + 101*time.Millisecond)
} else {
time.Sleep(nackBackoffPolicy.Next(1) + 101*time.Millisecond)
}

Here, 100 milliseconds is for the client tick delay. But we only wait for another 1 millisecond. This seems too short and introduces the flaky.

This PR waits for more 200 milliseconds. This will not affect the correctness of the test. Because the minimum interval NackDelay we used in these tests is 300 milliseconds. Waiting more 200 milliseconds will not affect the test result.

Modifications

  • Wait for more 200 milliseconds to reduce the flaky

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes / no)
  • The schema: (yes / no / don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / GoDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@RobertIndie RobertIndie added this to the v0.11.0 milestone May 11, 2023
@RobertIndie RobertIndie self-assigned this May 11, 2023
@shibd shibd merged commit 3f4a18b into apache:master May 12, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flaky Test] TestNacksTracker
2 participants