akka/akka-core

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

Open

#30.170 geöffnet am 7. Apr. 2021

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Scala (3.547 Forks)batch import
help wantednice-to-have (low-prio)t:testing

Repository-Metriken

Stars
 (13.277 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 17h 35m) (11 gemergte PRs in 30 T)

Beschreibung

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