-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
Fix EpollEventLoopTest.testSubmittingTaskWakesUpSuspendedExecutor flaky test #15650
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
base: 4.2
Are you sure you want to change the base?
Conversation
…ky test Motivation: The `testSubmittingTaskWakesUpSuspendedExecutor` test was failing due to a race condition where the test would check the executor's `isSuspended` status before its thread had time to update the state flag after waking up. Modifications: Instead of asserting the state immediately after the task's future completes, the test now polls for a short period, waiting for the flag to become true. Result: Fix flaky test.
83f80b2 to
b309a67
Compare
37a36bf to
c7dc459
Compare
c7dc459 to
d93d0ed
Compare
ca5db62 to
ed47da5
Compare
|
@georgebanasios let me know once I should have a look again |
|
@georgebanasios what is that purpose of the whole trigger the CI stuff ? seems like you not change anything in between |
|
@normanmaurer It seems that the test fails only on CI (i cant reproduce it locally), so I'm triggering the CI by repeating the test to see if my changes fixed it or not. For the majority of the runs it does not fail but for example on the last trigger I did, it failed again. |
| final Set<EventExecutor> newlyWokenExecutors = new HashSet<>(); | ||
|
|
||
| if (oldState.activeChildrenCount != currentState.activeChildrenCount) { | ||
| final Set<EventExecutor> oldActive = new HashSet<>(Arrays.asList(oldState.activeExecutors)); |
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.
Better just use Collections.addAll(...) to reduce object creation.
| final Set<EventExecutor> oldActive = new HashSet<>(Arrays.asList(oldState.activeExecutors)); | ||
|
|
||
| for (EventExecutor currentActive : currentState.activeExecutors) { | ||
| if (!oldActive.contains(currentActive)) { |
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.
Also maybe we not even need the Set at all as these really shouldn't be too many anyway and so looping might just be fine to find ?
Motivation:
The
testSubmittingTaskWakesUpSuspendedExecutortest was failing due to a race condition where the test would check the executor'sisSuspendedstatus before its thread had time to update the state flag after waking up.Modifications:
Instead of asserting the state immediately after the task's future completes, the test now polls for a short period, waiting for the flag to become true.
Result:
Fix flaky test.