apache / apache/pekko

Unstashed messages enqueued in TestActorRef mailbox while processing a message from self are stuck until another message is received

Open
#1,825 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
1.6k
Forks
211
Avg merge
1d 6h
Merged PRs (30d)
89

Description

This is a bug created on the pekko side for the issue here: https://github.com/akka/akka/issues/30170

In the following workflow, unstashed messages are enqueued in the mailbox but are not processed as expected:

1. Send message (`messageOne`) from TestKit to TestActorRef
2. TestActorRef underlying actor stashes `messageOne` and schedules a subsequent message to self (`selfMessage`)
3. `selfMessage` is sent and processed and `messageOne` is unstashed during processing of `selfMessage`
4. `messageOne` is not processed
5. Send another message (`messageTwo`) from TestKit to TestActorRef
6. Both `messageOne` and `messageTwo` are processed

`akka.testkit.CallingThreadDispatcher#runQueue` appears to process the provided `MessageQueue` at the time of invocation rather than using the active `Mailbox` `MessageQueue`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.