openstack-charmers / zaza

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

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

Closed rgildein closed 6 months ago

rgildein commented 6 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 6 months ago

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

ajkavanagh commented 6 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 6 months ago

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

rgildein commented 6 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.