Updates this configuration to forcibly enable async support. Only useful in fuzzers which do async calls.
(&mut self, u: &mut Unstructured<'_>)
| 547 | /// Updates this configuration to forcibly enable async support. Only useful |
| 548 | /// in fuzzers which do async calls. |
| 549 | pub fn enable_async(&mut self, u: &mut Unstructured<'_>) -> arbitrary::Result<()> { |
| 550 | if self.wasmtime.consume_fuel || u.arbitrary()? { |
| 551 | self.wasmtime.async_config = |
| 552 | AsyncConfig::YieldWithFuel(u.int_in_range(1000..=100_000)?); |
| 553 | self.wasmtime.consume_fuel = true; |
| 554 | } else { |
| 555 | self.wasmtime.async_config = AsyncConfig::YieldWithEpochs { |
| 556 | dur: Duration::from_millis(u.int_in_range(1..=10)?), |
| 557 | ticks: u.int_in_range(1..=10)?, |
| 558 | }; |
| 559 | self.wasmtime.epoch_interruption = true; |
| 560 | } |
| 561 | Ok(()) |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | impl<'a> Arbitrary<'a> for Config { |