Reproduce and fix the problem with suspended overrides being delivered simultaneously#94
Draft
jakzal wants to merge 4 commits into
Draft
Reproduce and fix the problem with suspended overrides being delivered simultaneously#94jakzal wants to merge 4 commits into
jakzal wants to merge 4 commits into
Conversation
fc30006 to
9ab4e66
Compare
jakzal
commented
Dec 14, 2021
| mailbox.send(message); | ||
| } | ||
|
|
||
| assertEquals(Arrays.asList(0, 1, 2), actor.testResults.getCounts()); |
Member
Author
There was a problem hiding this comment.
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)
jakzal
commented
Dec 14, 2021
| @Test | ||
| public void testThatSuspendedOverrideMessagesAreDeliveredInOrderTheyArrived() { | ||
|
|
||
| final Dispatcher dispatcher = new ExecutorDispatcher(2, 0, 1.0f); |
Member
Author
There was a problem hiding this comment.
Notice that the number of threads needs to be at least 2 for this test to fail.
8bbccfd to
780c3cc
Compare
jakzal
commented
Dec 14, 2021
| return queue.poll(); | ||
| } else { | ||
| return suspendedDeliveryQueue.get().poll(); | ||
| } |
Member
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.