mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed?
<!-- Describe what has changed in this PR -->
It turned out to be more involved than I initially anticipated.
1. All persistence fault injection related code is moved to
`faultinjection` package under `common/persistence`. I split it to a few
files with better names and clear responsibilities. Unexported almost
all identifiers in the package.
2. Fault injection config used to have two modes:
* flat rate for all APIs
* configurable rate for specific API of specific store with specific
errors.
It turned out that flat rate is not practical because tests becomes
unpredictable (can fail during init phase) and we actually don't use it.
I removed this option and it simplified fault injection code a lot.
## Why?
<!-- Tell your future self why have you made these changes -->
Refactoring, simplicity.
## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
Existing tests + added few more tests.
## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
No risks.
## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->
No.
## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
No.
33 lines
904 B
YAML
33 lines
904 B
YAML
faultInjection:
|
|
targets:
|
|
dataStores:
|
|
ExecutionStore:
|
|
methods:
|
|
CreateWorkflowExecution:
|
|
errors:
|
|
ResourceExhausted: 0.01
|
|
Timeout: 0.01
|
|
ExecuteAndTimeout: 0.01
|
|
UpdateWorkflowExecution:
|
|
errors:
|
|
ResourceExhausted: 0.01
|
|
Timeout: 0.01
|
|
ExecuteAndTimeout: 0.01
|
|
GetWorkflowExecution:
|
|
errors:
|
|
ResourceExhausted: 0.01
|
|
Timeout: 0.01
|
|
GetCurrentExecution:
|
|
errors:
|
|
ResourceExhausted: 0.01
|
|
Timeout: 0.01
|
|
AppendHistoryNodes:
|
|
errors:
|
|
ResourceExhausted: 0.01
|
|
Timeout: 0.01
|
|
ExecuteAndTimeout: 0.01
|
|
ReadHistoryBranch:
|
|
errors:
|
|
ResourceExhausted: 0.01
|
|
Timeout: 0.01
|