Unit state during charm upgrade
Benji York
benji.york at canonical.com
Mon Mar 5 15:53:52 UTC 2012
On Mon, Mar 5, 2012 at 10:48 AM, Kapil Thangavelu
<kapil.thangavelu at canonical.com> wrote:
> Excerpts from Francesco Banconi's message of 2012-03-05 09:03:56 -0500:
>> Hi everybody,
>>
>> while working on functional tests for our charms, I've seen that, having
>> a started unit, the unit state remains "started" during charm upgrade.
>>
>> In my tests I ended up waiting a few seconds before checking the unit
>> state using `juju status`. However, in my opinion, the charm upgrade
>> could be more testable if a state transition is performed during upgrade.
>> E.g.: the charm switch to state "pending" (or "upgrading" or something
>> else) when `juju upgrade-charm` is invoked, and then back again to
>> "started" if the hook completes successfully.
>>
>> I hope my suggestion will be of some use.
>> Thank you!
>
> what's the value add? if the upgrade hook executes quickly enough its just
> introducing a race condition around watching for an ephemeral state.
I think we would need something like the charm revision exposed so the
test can know when the upgrade is complete. We can always sleep for
some amount of time, but that's obviously brittle.
--
Benji York
More information about the Juju
mailing list