assertj-swing icon indicating copy to clipboard operation
assertj-swing copied to clipboard

waitForIdle issue

Open Neitsch opened this issue 10 years ago • 1 comments

Given the method waitForIdle from the BasicRobot. It iterates through all queues and waits until the queue is cleared before moving to the next. But given a scenario with queues A and B. B is working. Robot checks A. Robot checks B. Waits. B enqueues element in A. Robot checks B --> All queues cleared, though A is still working.

I have a possible solution in mind, let me know what you think.

Neitsch avatar Aug 19 '15 07:08 Neitsch

Hi @Neitsch thanks for opening the issue. Do you have a scenario where this would pop up or is it just a good analysis of our codebase plus thinking about some ways to break it?

Because I think this is not a real issue as the intention of waitForIdle is to wait for pending events (as of now) being processed before further actions are done. When A has been checked then we assume no further checks are needed. As waiting for B might only result in further waiting - so we can't return too early.

In your scenario this might be wrong indeed. Because the events of B are not completely processed until A is done with executing the elements B enqueued. So a good solution might be better than the current implementation even if it's just a theoretical problem (at the moment).

Anyway I'm interested in your solution :)

croesch avatar Oct 05 '15 09:10 croesch