Skip to content

Maintain: fix flaky test unit caused by enqueue not complete instantly #2290

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jinliu9508
Copy link
Contributor

@jinliu9508 jinliu9508 commented May 2, 2025

Since OperationRepo.enqueue() was changed to internal enqueue in a separate coroutine scope, we can no longer expect calling OperationRepo.enqueue() can instantly insert the operation. Adding a delay after each enqueue call in the unit test to give time for the internal enqueuing to actually complete.


This change is Reviewable

@jinliu9508 jinliu9508 requested review from jkasten2 and nan-li May 2, 2025 19:08
@jinliu9508 jinliu9508 force-pushed the flaky-test-enqueue-not-instant branch from 9dd81d2 to 7adb9ed Compare May 2, 2025 19:13
@jinliu9508 jinliu9508 force-pushed the flaky-test-enqueue-not-instant branch from 7adb9ed to fa4c20a Compare May 2, 2025 19:24
Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

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

We shouldn't use delays and timeouts when it is feasible for tests. The root cause of this flaky test is going to be common, so let's invest in a better way to wait for the right event, instead of time based.

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.

2 participants