Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added autonomous actors #281

Merged
merged 5 commits into from
Mar 7, 2023
Merged

Added autonomous actors #281

merged 5 commits into from
Mar 7, 2023

Conversation

therealryan
Copy link
Contributor

@therealryan therealryan commented Mar 6, 2023

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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

96.0% 96.0% Coverage
0.0% 0.0% Duplication

@therealryan therealryan merged commit 1286603 into main Mar 7, 2023
@therealryan therealryan deleted the attack_of_the_autons branch March 7, 2023 10:53
@therealryan therealryan added the enhancement New feature or request label Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants