这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@georgebanasios
Copy link
Contributor

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.

…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.
@georgebanasios georgebanasios force-pushed the epoll-flaky-test branch 2 times, most recently from 37a36bf to c7dc459 Compare September 12, 2025 14:21
@normanmaurer
Copy link
Member

@georgebanasios let me know once I should have a look again

@normanmaurer
Copy link
Member

@georgebanasios what is that purpose of the whole trigger the CI stuff ? seems like you not change anything in between

@georgebanasios
Copy link
Contributor Author

georgebanasios commented Sep 16, 2025

@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.
There's a race condition between the test thread and the monitor which I haven't figured out yet.
Let me know if it's causing a problem ofc.

final Set<EventExecutor> newlyWokenExecutors = new HashSet<>();

if (oldState.activeChildrenCount != currentState.activeChildrenCount) {
final Set<EventExecutor> oldActive = new HashSet<>(Arrays.asList(oldState.activeExecutors));
Copy link
Member

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)) {
Copy link
Member

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 ?

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