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.
Flow works fine for synchronous systems (e.g.: A calls to B, which calls to C, which responds back to B, which responds back to A), where the system only does stuff in response to the test poking it with data.
Right now I'm adding tests to a system that includes a message queue that is working all the time regardless of test actions. I've got some flows that have the queue as the root cause, but in an integration test context there's nothing I can do with these flows - the root cause actor is part of the system under test. This is fine: those flows just get skipped and we have to assume that the stuff that the flows document is happening in the system, even if we don't have any visibility of it.
The problem I hit today comes when you add another flow that has the queue-rooted flow as a prerequisite - that new flow also gets skipped as the assertion framework see the skipped prerequisite and throws a wobbler: the system is stateful, but the prerequisite didn't (as far as the test knows) happen, so we can't assume that the required state is in place for this new flow! We have to skip it!
This change adds a mechanism to avoid this: we've added a new flocessor configuration option that allows you to denote some system actors as being autonomous. Now instead of a flow just being skipped we can check if the root actor for that flow is autonomous. If it is then we tag that flow with a special
NOT_OBSERVED
result in the flow-result history that allows the test to assume that the flow actions did happen, and so allow subsequent dependent flows to be processed as normal.