openstack-charmers / zaza

A Python3-only functional test framework for Charms
Apache License 2.0
11 stars 47 forks source link

The behavior of model.run_on_unit has been changed to run only actions #649

Closed rgildein closed 8 months ago

rgildein commented 8 months ago

The async_run_on_unit function was changed (by commit) to wait for actions and like this is no longer possible to run command with it. I'm not sure if there's any way to fix this, but I'd at least suggest renaming the command parameter to action.

agileshaw commented 8 months ago

It seems that this is the line where running command instead of action hangs.

ajkavanagh commented 8 months ago

@rgildein it's probably that actions on Juju 3.x wait by default, whereas on Juju 2.x they didn't. Maybe this has been propagated to libjuju aswell? (i.e. Juju 3.x run needs the --background flag to have the same behaviour as Juju 2.x. run-action).

wolsen commented 8 months ago

This should be fixed with the above PR being merged. Please re-open if not.

rgildein commented 8 months ago

I can confirm that it's working now.

@ajkavanagh the libjuju 2.9 is by default waiting if you are using run, but in libjuju 3.1 you need to provide block=True or wait yourself.