juju / amulet

Testing harness and tools for Juju Charms
Other
17 stars 33 forks source link

Wait changes: add_unit & wait_for_statuses #106

Closed johnsca closed 7 years ago

johnsca commented 9 years ago

Removed implicit wait from add_unit (fixes #105 though it may need test changes to ensure proper wait).

Also added wait_for_statuses to wait against workload statuses to go along with waiting against workload status messages.

tvansteenburgh commented 9 years ago

@johnsca I don't see anything here that deals with the scenario you mentioned earlier: "What about the case of calling add_unit() and then sentry.wait(), but the unit not yet showing up at all in status and thus wait() immediately returning?"

johnsca commented 9 years ago

@tvansteenburgh Regarding wait returning immediately after add_unit, I don't see a way around that other than passing a list into wait_for_statuses or wait_for_messages to enforce a specific number of units.

I feel like we're quickly converging on the realm of Tangle and needing a DSL to describe the "expected state of the system" and just say "wait for delta from current to expected state to be zero."

tvansteenburgh commented 9 years ago

@johnsca Well we know how many units of the service we should have at that point, so we could make a private sentry._wait_for_units(...) or something.

johnsca commented 8 years ago

I updated the PR to resolve merge conflicts, handle added units, reference regexps in the wait_for_statuses docstring, and address other items in review.

dpb1 commented 8 years ago

Hi all -- could we take another pass at this? or land #114?

dpb1 commented 8 years ago

Hi @johnsca -- Any update on this? #114 is ready and willing to land as well.