Testing a Recovery Path with an Ordinary Simulated Failure

Inject a controlled failure into a dependency to check the state and result after an incomplete operation.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace a safe example
  2. Keep the simulation focused

Trace a safe example

A file abstraction can refuse a simulated write after the first successful record. Verify the program reports failure and keeps any committed previous output. A replace-after-complete-write rule gives a way to reason about the visible file.

Keep the simulation focused

The caller needs to observe the same failure contract as the normal storage implementation. Dependency arguments make it possible to simulate that result without interfering with another user's or process's resources.[1]

References

  1. Python Software Foundation, Python Tutorial: Errors and Exceptions ↩