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

Abstract out agent execution environment #118

Open
4 of 8 tasks
pablochacin opened this issue Feb 28, 2023 · 0 comments · Fixed by #172
Open
4 of 8 tasks

Abstract out agent execution environment #118

pablochacin opened this issue Feb 28, 2023 · 0 comments · Fixed by #172
Assignees
Labels
enhancement New feature or request Epic Umbrella issue for implementing multiple features or solving multiple issues

Comments

@pablochacin
Copy link
Collaborator

pablochacin commented Feb 28, 2023

The disruptor agent is responsible for injecting faults in the disruption target. The reliability of the agent is critical to ensure the chaos tests do not disrupt the target in unpredictable ways or that its effects last beyond the duration of the fault injection. Therefore, the testability of the agent is a key requirement.

However, in order to inject faults, the agent must interact with the target's execution environment. For example, executing commands to modify the configuration or execute other tasks.

These kinds of interactions are difficult to test because the functions the golang standard library offers for interacting with the execution environment (mostly under the os package) are not provided as interfaces that could be mocked.

One alternative that has already been applied for the execution of commands is to provide abstractions for these functions that can be easily mocked in tests.

This approach can be extended to:

  • Environment variables
  • Process execution
  • CLI arguments
  • Access to the file system
  • Console output
  • Signal handling
  • Process exit
  • Process execution lock

This same approach has been used in k6 by introducing a global state

@pablochacin pablochacin added enhancement New feature or request Epic Umbrella issue for implementing multiple features or solving multiple issues labels Feb 28, 2023
@pablochacin pablochacin changed the title Abstract agent execution environment Abstract out agent execution environment Feb 28, 2023
@pablochacin pablochacin self-assigned this May 16, 2023
@pablochacin pablochacin reopened this Aug 1, 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 Epic Umbrella issue for implementing multiple features or solving multiple issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant