Module Ir.Resource_fault_injection

Test-only fault-injection points for resource-owning seams.

Production code calls hit at boundaries where an exception must leave resource ownership honest. The default callback is a no-op and no configuration selects it. Tests install a callback with with_callback; callbacks are process-global, so scenarios must not run in parallel.

type point =
  1. | Delta_pool_allocated
  2. | Transfer_pool_allocated
  3. | From_host_before_copy
  4. | From_host_before_await
  5. | Transfer_cleanup_before_await
  6. | To_host_before_copy
  7. | Finalize_before_await
  8. | Finalize_before_free
  9. | Schedule_cache_before_commit
  10. | Schedule_cache_before_replay
val sexp_of_point : point -> Sexplib0.Sexp.t
val point_of_sexp : Sexplib0.Sexp.t -> point
val equal_point : point -> point -> bool
val hit : point -> unit
val with_callback : (point -> unit) -> f:(unit -> 'a) -> 'a

Installs the callback for f and restores the prior callback even when f raises.