Repeatedly run the given test function, injecting OOMs at different times and checking that it correctly handles them. The test function should not use threads, or else allocations may not be tracked correctly and OOM injection may be incorrect. The test function should return an `Err(_)` if and only if it encounters an OOM. Returns early once the test function returns `Ok(())` before an OOM ha
(&self, test_func: impl Fn() -> Result<()>)
| 313 | /// Returns early once the test function returns `Ok(())` before an OOM has |
| 314 | /// been injected. |
| 315 | pub fn test(&self, test_func: impl Fn() -> Result<()>) -> Result<()> { |
| 316 | let future = self.test_async(|| async { test_func() }); |
| 317 | crate::block_on(future) |
| 318 | } |
| 319 | |
| 320 | /// The same as `test` but `async`. |
| 321 | pub async fn test_async(&self, test_func: impl AsyncFn() -> Result<()>) -> Result<()> { |