<div dir="ltr">Okay, 4m30s is probably short, thanks for that Tim, I'll crank it up and see what happens.<div><br></div><div>Tom</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">--------------<div><br></div><div><div style="font-size:small"><font color="#999999">Director Meteorite.bi - Saiku Analytics Founder</font></div><div style="font-size:small"><font color="#999999">Tel: +44(0)5603641316 </font></div><div style="font-size:small"><font color="#999999"><br></font></div><div style="font-size:small"><font color="#999999">(Thanks to the Saiku community we reached our <a href="http://kickstarter.com/projects/2117053714/saiku-reporting-interactive-report-designer/" target="_blank">Kickstart</a> goal, but you can always help by <a href="http://www.meteorite.bi/products/saiku/sponsorship" target="_blank">sponsoring the project</a>)</font></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On 15 March 2016 at 17:02, Tim Van Steenburgh <span dir="ltr"><<a href="mailto:tim.van.steenburgh@canonical.com" target="_blank">tim.van.steenburgh@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Mar 15, 2016 at 12:30 PM, Tom Barber <span dir="ltr"><<a href="mailto:tom@analytical-labs.com" target="_blank">tom@analytical-labs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Tim,<div><br></div><div>Why would I need to increase the timeout when the status says all the unit are operational?</div></div></blockquote><div><br></div></span><div>The default wait time is 300s, with an "idle threshold" of 30s. Which means, it waits for everything to be idle for 30s before returning from the wait. This means that with the default timeout, if the env doesn't settle within 4m30s, it'll time out. This may not be what's happening in your case, but it's worth trying a longer timeout value to make sure. </div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>The status dump came out of bundletester which said that it failed on the first wait(), I assume the status dump arrived at the same time?</div><div>Bugs are allowed, the test was hacked up from a previous one, it doesn't do anything yet, I'm trying to make sure the logic works first.</div><span><font color="#888888"><div><br></div><div>Tom</div></font></span></div><div class="gmail_extra"><span><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr">--------------<div><br></div><div><div style="font-size:small"><font color="#999999">Director Meteorite.bi - Saiku Analytics Founder</font></div><div style="font-size:small"><font color="#999999">Tel: <a href="tel:%2B44%280%295603641316" value="+445603641316" target="_blank">+44(0)5603641316</a> </font></div><div style="font-size:small"><font color="#999999"><br></font></div><div style="font-size:small"><font color="#999999">(Thanks to the Saiku community we reached our <a href="http://kickstarter.com/projects/2117053714/saiku-reporting-interactive-report-designer/" target="_blank">Kickstart</a> goal, but you can always help by <a href="http://www.meteorite.bi/products/saiku/sponsorship" target="_blank">sponsoring the project</a>)</font></div></div></div></div></div></div></div>
<br></span><div><div><div class="gmail_quote">On 15 March 2016 at 16:27, Tim Van Steenburgh <span dir="ltr"><<a href="mailto:tim.van.steenburgh@canonical.com" target="_blank">tim.van.steenburgh@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey Tom,<div><br></div><div>1. You can increase the wait time until it doesn't time out: self.d.sentry.wait(timeout=1200)</div><div>2. At what point in this sequence of commands was the status dump captured?</div><div>3. There is a bug here. You take a reference to the pdi/0 info dict on line 1. It's the same object you use to get message2 and message3 later. So, you'll get the same message that you got on line 1. You need `message3 = <span style="font-size:12.8px">self.d.sentry['pdi'][0].info['workload-status'].get('message')` instead.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Hope this helps.</span></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 15, 2016 at 11:41 AM, Tom Barber <span dir="ltr"><<a href="mailto:tom@analytical-labs.com" target="_blank">tom@analytical-labs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Okay back here again, so my nice leader election function looks like:<div><br></div><div><div> def test_leader_election_failover(self):</div><div> unit = self.d.sentry['pdi'][0].info</div><div> message = unit['workload-status'].get('message')</div><div> ip = message.split(':', 1)[-1]</div><div> self.d.add_unit('pdi', 2)</div><div> self.d.sentry.wait()</div><div> message2 = unit['workload-status'].get('message')</div><div> ip2 = message2.split(':', 1)[-1]</div><div> self.assertEqual(ip, ip2)</div><div> self.d.remove_unit('pdi/0')</div><div> self.d.sentry.wait()</div><div> message3 = unit['workload-status'].get('message')</div><div> ip3 = message3.split(':', 1)[-1]</div><div><br></div><div> self.assertNotEqual(ip3, ip2)</div></div><div><br></div><div>I know there's no logic in there, but I need to make sure the stuff actually functions.</div><div><br></div><div>So Tim says wait() should work, but when I tested this last night,</div><div><br></div><div>I get a timeout error o the wait right after add_unit.</div><div><br></div><div><a href="https://gist.github.com/buggtb/c271dd79d782af57dea6" target="_blank">https://gist.github.com/buggtb/c271dd79d782af57dea6</a><br></div><div><br></div><div>Yet in the status dump you can see all 3 units sat there seemingly happy.</div><span><font color="#888888"><div><br></div><div>Tom</div></font></span></div><div class="gmail_extra"><span><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr">--------------<div><br></div><div><div style="font-size:small"><font color="#999999">Director Meteorite.bi - Saiku Analytics Founder</font></div><div style="font-size:small"><font color="#999999">Tel: <a href="tel:%2B44%280%295603641316" value="+445603641316" target="_blank">+44(0)5603641316</a> </font></div><div style="font-size:small"><font color="#999999"><br></font></div><div style="font-size:small"><font color="#999999">(Thanks to the Saiku community we reached our <a href="http://kickstarter.com/projects/2117053714/saiku-reporting-interactive-report-designer/" target="_blank">Kickstart</a> goal, but you can always help by <a href="http://www.meteorite.bi/products/saiku/sponsorship" target="_blank">sponsoring the project</a>)</font></div></div></div></div></div></div></div>
<br></span><div><div><div class="gmail_quote">On 9 March 2016 at 18:31, Tom Barber <span dir="ltr"><<a href="mailto:tom@analytical-labs.com" target="_blank">tom@analytical-labs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Oh really?<div><br></div><div>/me stokes his invisible beard.</div><div><br></div><div><br></div><div>Okay I'll go back and try again.</div><span><font color="#888888"><div><br></div><div>Tom</div></font></span></div><div class="gmail_extra"><span><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr">--------------<div><br></div><div><div style="font-size:small"><font color="#999999">Director Meteorite.bi - Saiku Analytics Founder</font></div><div style="font-size:small"><font color="#999999">Tel: <a href="tel:%2B44%280%295603641316" value="+445603641316" target="_blank">+44(0)5603641316</a> </font></div><div style="font-size:small"><font color="#999999"><br></font></div><div style="font-size:small"><font color="#999999">(Thanks to the Saiku community we reached our <a href="http://kickstarter.com/projects/2117053714/saiku-reporting-interactive-report-designer/" target="_blank">Kickstart</a> goal, but you can always help by <a href="http://www.meteorite.bi/products/saiku/sponsorship" target="_blank">sponsoring the project</a>)</font></div></div></div></div></div></div></div>
<br></span><div><div><div class="gmail_quote">On 9 March 2016 at 16:56, Tim Van Steenburgh <span dir="ltr"><<a href="mailto:tim.van.steenburgh@canonical.com" target="_blank">tim.van.steenburgh@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Wed, Mar 9, 2016 at 6:31 AM, Tom Barber <span dir="ltr"><<a href="mailto:tom@analytical-labs.com" target="_blank">tom@analytical-labs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Stuart.<div><br></div><div>I do put a note in my charm message indicating the leader IP address so that users know which to connect to.</div><div><br></div><div>So with juju wait, would I destroy a unit then execute juju wait? At which point it will hang until the leader election stuff is over and all becomes stable again?</div><div><br></div></div></blockquote><div><br></div></span><div>Since you're already using amulet, there's no need to use the juju-wait plugin</div><div>since d.sentry.wait() does the same thing. So yes, you would do d.remove_unit(...)</div><div>and then call d.sentry.wait().</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div><div>Also, will this work if I push it upstream to the charmers and the automated tests up there?</div><div><br></div></div></blockquote><div><br></div></span><div>Yes. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><div dir="ltr"><div></div><div>Thanks</div><div><br></div><div>Tom</div></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr">--------------<div><br></div><div><div style="font-size:small"><font color="#999999">Director Meteorite.bi - Saiku Analytics Founder</font></div><div style="font-size:small"><font color="#999999">Tel: <a href="tel:%2B44%280%295603641316" value="+445603641316" target="_blank">+44(0)5603641316</a> </font></div><div style="font-size:small"><font color="#999999"><br></font></div><div style="font-size:small"><font color="#999999">(Thanks to the Saiku community we reached our <a href="http://kickstarter.com/projects/2117053714/saiku-reporting-interactive-report-designer/" target="_blank">Kickstart</a> goal, but you can always help by <a href="http://www.meteorite.bi/products/saiku/sponsorship" target="_blank">sponsoring the project</a>)</font></div></div></div></div></div></div></div><span>
<br><div class="gmail_quote">On 9 March 2016 at 11:00, Stuart Bishop <span dir="ltr"><<a href="mailto:stuart.bishop@canonical.com" target="_blank">stuart.bishop@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 9 March 2016 at 20:31, Tom Barber <<a href="mailto:tom@analytical-labs.com" target="_blank">tom@analytical-labs.com</a>> wrote:<br>
> Morning all<br>
><br>
> I'm trying to test for charm reconfiguration if the leader goes AWOL.<br>
<br>
</span>I put the role of the unit in its workload status, so it is easy for<br>
operators to see which unit is master. And this also makes it easy for<br>
tests to tell.<br>
<span><br>
<br>
> Adam suggested that I watch the status waiting for the next leader election<br>
> hook the wait on that and then check my service configs.<br>
<br>
</span>You are best of waiting for all the hooks to complete and a steady<br>
state, not just leader elected (since things will still be in flux<br>
when that hook fires, such as the leader-settings-changed hooks it<br>
will probably trigger and the relation changes those hooks will likely<br>
trigger). Use the juju-wait plugin, and maybe add support to<br>
<a href="https://bugs.launchpad.net/juju-core/+bug/1488777" rel="noreferrer" target="_blank">https://bugs.launchpad.net/juju-core/+bug/1488777</a> to get this into<br>
core.<br>
<span><font color="#888888"><br>
--<br>
Stuart Bishop <<a href="mailto:stuart.bishop@canonical.com" target="_blank">stuart.bishop@canonical.com</a>><br>
</font></span></blockquote></div><br></span></div>
<br></span><span><font color="#888888">--<br>
Juju mailing list<br>
<a href="mailto:Juju@lists.ubuntu.com" target="_blank">Juju@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju</a><br>
<br></font></span></blockquote></div><br></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>