charmed-kubernetes / pytest-operator

Apache License 2.0
6 stars 13 forks source link

fast-forward status-update hooks context #78

Closed PietroPasotti closed 2 years ago

PietroPasotti commented 2 years ago

I found it was a useful pattern to temporarily speed up the status-update hook firing rate. This looks like a job for a context manager.

Proposal:

async with ops_test.fast_forward('10s'):
   # do stuff which might take some time to reflect on the workload status
   assert ops_test.model.wait_for_idle(...)
addyess commented 2 years ago

Merged and published as pytest_operator-0.21.0