Make BehaviorTestKit message adaptation more synchronous #31406
Labels
1 - triaged
Tickets that are safe to pick up for contributing in terms of likeliness of being accepted
t:testing
(Taking from a discussion in #30050)
As it stands, when using the
BehaviorTestKit
to test a behavior which performs message adaptation, testing the adaptation requires a call totestkit.runOne()
to process the adaptation.The message in the
selfInbox
is not inspectable and this arguably exposes too much of the internal machinery.#30050 plumbs the testkit through to the
EffectfulActorContext
, which allows the completion of the ask to synchronously run message adaptation in the behavior interceptor without going through theselfInbox
. A similar approach can be taken with message adaptation to improve ergonomics in the common case.As with the ask, if a behavior, in response to some message, sets up an adaptation and sends a message to itself, it would now be the responsibility of the test to
runOne
before sending to the adapter (which is in fact already implicitly the case: in the above test, if there was already a message in theselfInbox
it would be run, not the adapted message).If this change is made, it most likely could not be until 2.7/3.0, due to the potential test breakage.
The text was updated successfully, but these errors were encountered: