akka/akka-core

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

開放

#30,170 建立於 2021年4月7日

 (1 則留言) (0 個反應) (0 位負責人)Scala (3,547 個分叉)batch import
help wantednice-to-have (low-prio)t:testing

倉庫指標

星標
 (13,277 顆星)
PR 合併指標
 (平均合併 8天 19小時) (30 天內合併 10 個 PR)

描述

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.

貢獻者指南