-
Notifications
You must be signed in to change notification settings - Fork 28
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
Reproduce and fix the problem with suspended overrides being delivered simultaneously #94
base: master
Are you sure you want to change the base?
Conversation
fc30006
to
9ab4e66
Compare
mailbox.send(message); | ||
} | ||
|
||
assertEquals(Arrays.asList(0, 1, 2), actor.testResults.getCounts()); |
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.
This is failing with: expected:<[0, 1, 2]> but was:<[1, 2, 0]>
Error: Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.455 s <<< FAILURE! - in io.vlingo.xoom.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailboxTest
Error: testThatSuspendedOverrideMessagesAreDeliveredInOrderTheyArrived(io.vlingo.xoom.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailboxTest) Time elapsed: 0.117 s <<< FAILURE!
java.lang.AssertionError: expected:<[0, 1, 2]> but was:<[1, 2, 0]>
at io.vlingo.xoom.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailboxTest.testThatSuspendedOverrideMessagesAreDeliveredInOrderTheyArrived(ConcurrentQueueMailboxTest.java:113)
@Test | ||
public void testThatSuspendedOverrideMessagesAreDeliveredInOrderTheyArrived() { | ||
|
||
final Dispatcher dispatcher = new ExecutorDispatcher(2, 0, 1.0f); |
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.
Notice that the number of threads needs to be at least 2 for this test to fail.
8bbccfd
to
780c3cc
Compare
return queue.poll(); | ||
} else { | ||
return suspendedDeliveryQueue.get().poll(); | ||
} |
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.
I changed receive()
to also look at the suspended delivery queue. This is a public method so I'm not 100% sure I should've done it...
…aneously Signed-off-by: Jakub Zalas <jakub@zalas.pl>
Signed-off-by: Jakub Zalas <jakub@zalas.pl>
Signed-off-by: Jakub Zalas <jakub@zalas.pl>
… resume Signed-off-by: Jakub Zalas <jakub@zalas.pl>
7a6b1c0
to
3ebaae3
Compare
No description provided.