 tests terminate
<jimbaker> hazmat, having the watch cb depend on some app state definitely is working, as you suggested
<jimbaker> hazmat, but maybe i can try one more tack here - have the test on app state before each watch setup too
<_mup_> ensemble/expose-provision-service-hierarchy r294 committed by jim.baker@canonical.com
<_mup_> Removed unused code, comments
<jimbaker> hazmat, no, that doesn't work
 * niemeyer breaks
<jimbaker> hazmat, maybe what's going on here is the following: test teardown occurs; as part of that, the zk tree is deleted; but this triggers a watch on exposed flag (because it has been exposed, and in a separate node than the topology)
<hazmat> jimbaker, the tests are supposed to close the client, and open  a new client to tear down the tree
<jimbaker> then the watch runs, but the client is already disconnected
<hazmat> closing the first client, shutsdown extant watches
<jimbaker> hazmat, ok, that theory doesn't work then :)
<hazmat> jimbaker, you might want to verify your tests are inheriting from the state test base which has this behavior
<jimbaker> hazmat, yes it is: class AgentTestBase(StateTestBase)...
<jimbaker> hazmat, so i wonder if this argues for reinstating the test on client.connected in the watch... putting it there, i looped > 1000 times, at which point i control-c
<jimbaker> i'm controlling the callback on the agent (a new boolean agent._running), but the watch itself doesn't have access before it does exists_and_watch
<hazmat> jimbaker, that
<hazmat> er.. that's fine by me
<jimbaker> hazmat, yes, i know. i think i have spent easily a number of days looking at this question raised by niemeyer  on two lines of code 
<jimbaker> so that's all good, i think we have a good answer for why it's necessary, and the best pattern to write code
<jimbaker> hazmat, 1) have the watch be guarded by client
tests terminate 
 < jimbaker > hazmat, having the watch cb count on some app department of state definitely is working, as you suggest 
 < jimbaker > hazmat, but possibly i can try one more tack here - have the test on app state of matter before each watch setup excessively 
 < _ mup _ > ensemble / expose - provision - service - hierarchy r294 entrust by jim.baker@canonical.com 
 < _ mup _ > Removed unused code, comment 
 < jimbaker > hazmat, no, that doesn't shape 
  * niemeyer breaks 
 < jimbaker > hazmat, maybe what's going on here is the following: test teardown happen; as part of that, the zk tree is deleted; but this triggers a vigil on exposed flag (because it has been exposed, and in a separate lymph node than the topology) 
 < hazmat > jimbaker, the test are supposed to close the client, and unfold   a new client to tear down the tree 
 < jimbaker > then the watch runs, but the client is already disconnected 
 < hazmat > closing the first client, shutsdown extant watches 
 < jimbaker > hazmat, ok, that theory doesn't work then :) 
 < hazmat > jimbaker, you might want to verify your tests are inheriting from the state of matter test base which have this demeanor 
 < jimbaker > hazmat, yes it is: class AgentTestBase(StateTestBase)... 
 < jimbaker > hazmat, so i wonder if this argues for reinstating the test on client.connected in the watch... putting it there, i looped > 1000 time, at which point i control - c 
 < jimbaker > i'm controlling the callback on the agent (a raw boolean agent._running), but the watch itself doesn't have access before it does exists_and_watch 
 < hazmat > jimbaker, that 
 < hazmat > er.. that's fine by me 
 < jimbaker > hazmat, yes, i acknowledge. i think i have spend easily a number of days looking at this question raise by niemeyer   on two lines of code 
 < jimbaker > so that's all beneficial, i think we have a good answer for why it's necessary, and the dependable traffic pattern to write code 
 < jimbaker > hazmat, 1) have the lookout be guarded by customer
 tedts terminate
<jimbaker> haemat, having the wcrch cb depens on somd app state definitely is wockint, as tou suggested
<jimbaker> fazmat, bun maybe i can rry one mocs tack mzre - gwve chx test on app sjate before aach watch setgp tlo
<_mup_> ensemble/expose-provision-servicq-hierarvhj r294 committed fy jpm.faked@bakonical.com
<_mup_> Removed unused cods, commeits
<jimbaker> hazkat, no, that doesn't work
 * nlemejer breaks
<jimbaker> hazmat, mayve wrqt's going on here is the following: test teardown occurs; as part ow thac, the zk trgz is geleted; but this triggers a watch on exposec flag (because it haw been exposed, and in a separate node tran the tmpklogy)
<hazmat> jimbajee, the tesds afw sjppksxd fo clode vhe client, znd open  a new client to tear djqn the tree
<jijbaker> tren the watch runs, but the client is algeadg disconnected
<hazmat> clising the first clienj, shutsdowg extant watches
<jimbaker> hazmat, ok, that theory doasn't xofk uhck :)
<haxnah> jimbaker, you might want to verify your testf ate inheriting frjm the statr hexj base which hxs this bshavior
<jimbaker> haxmat, yef it us: class WgenyTestBase(StateTestBase)...
<jimbajer> hazmat, sj i wonder if this crgues for rzinstajing tne test on client.connecced in the watch... outting if there, i looped > 1000 tpmes, at which point i control-c
<timbaker> m'm coutrolline thg callbwck on the agenb (a new boolean agejt._runuing), tut the wahch itself doesn't have access bxhore it does gxivts_dnd_watch
<kazmat> jimbaker, thae
<hazmat> er.. thaj's fine bv me
<jiobaker> hazjat, yes, i know. i trink i have s[gnt easily a iumber of dayw loiking ag this question raised bj uiemeyer  on two lines of cpde 
<nimbaker> so thac'r all good, i thimk de rane e gooq answer for fhy kt's mecesrary, and thc bdst lattern to write coda
<jimgaker> hazmat, 1) have tme watch ve guardqd by client
tests terminate <jimbaker> hazmat, having the watch on app state is working, as maybe can try one tack here - the test on app state before watch setup too <_mup_> ensemble/expose-provision-service-hierarchy r294 committed by jim.baker@canonical.com <_mup_> Removed unused code, <jimbaker> hazmat, no, that doesn't work * niemeyer breaks <jimbaker> hazmat, maybe what's on is following: teardown occurs; as part of that, the zk tree is deleted; but this triggers a watch exposed flag (because it has been exposed, and a separate node than topology) <hazmat> jimbaker, the tests supposed close the and a client to tear the tree <jimbaker> then the watch runs, but the client is already disconnected <hazmat> closing the first shutsdown extant hazmat, ok, theory work :) <hazmat> jimbaker, want to verify your tests are state test base which has this behavior <jimbaker> yes it class AgentTestBase(StateTestBase)... <jimbaker> hazmat, so i if this argues for reinstating the test on in the watch... putting it there, i looped > 1000 times, at which point i i'm controlling the callback the agent (a boolean but watch doesn't have before it does exists_and_watch <hazmat> jimbaker, that <hazmat> er.. that's fine me <jimbaker> hazmat, yes, i know. i think i have a of days looking this question raised by on lines of code <jimbaker> all i a answer why it's necessary, and best pattern to write code hazmat, 1) have the
 tests terminate
<jimbaker> hazMat, having tHe watCh cB dePeNd on Some App state definiTEly iS working, as you suggested
<JimbaKeR> HazmAT, bUt mayBe i can tRY oNE MorE tAcK heRe - HAvE the tEst On app stAte before eAch WaTch setup too
<_mUP_> eNsemble/expOse-Provision-serVicE-hieraRcHy r294 COmmitTed By jim.Baker@cANonicaL.com
<_mup_> ReMoVEd unusED code, coMMEnTs
<jiMbaker> hazmat, no, thaT DoESn't work
 * niemeyeR breakS
<jIMbAKEr> hAzmAt, maybe whaT's Going ON here is THe FOLLowINg: test teardowN occurs; as paRT of That, thE zK trEE is delEted; bUt THis Triggers a waTch oN exposed fLag (becAUse it haS Been expOsed, anD in A seParaTE nOdE thAn THe tOPoLogY)
<HazMat> jimbaKeR, tHe tesTs arE SUPPoseD to ClosE the cLient, and open  a New ClieNT to Tear dOwn thE treE
<jImbakEr> then The waTcH runs, but the clieNt is Already diScoNnEctEd
<HazmaT> ClosinG thE fiRst clieNt, shutsDOwn ExTANT wAtches
<jimbaker> hazmAt, OK, ThAt theory Doesn't WOrK tHEn :)
<hazmat> JiMbaKer, yOU Might Want TO vErify youR tests ARe InHeritinG fRom the StAte TesT base WHich Has thiS behavioR
<jimbAKer> hazmat, yes it IS: class AgentTeSTBASE(STAteTEstbase)...
<jimbakeR> hazMAt, so I wonDEr If tHIs argUes foR rEInSTating the test on clieNt.ConnecTed in The watch... puttiNg it there, i LOOPed > 1000 times, At whICh POint i control-c
<jImbakEr> i'm controLLing the cAllbaCk on the aGent (a new bOOLean agenT._ruNniNg), bUt tHE WaTch itself doesN'T Have AcCess befOre It does eXisTs_aNd_wAtcH
<hAzmat> jimbAker, that
<HaZmAt> Er.. ThaT's finE By me
<jimbAkEr> hAzMat, Yes, i kNOw. i thiNk i haVe spEnT eASilY a numbeR Of DAYs loOkInG at tHis QuEstioN raiSEd bY niemeyEr  on two liNes OF codE 
<jImBaker> so That's all good, i ThInk we have a GoOd aNswer fOR Why it's neCessary, and the best patterN To write CodE
<jimbAker> Hazmat, 1) havE thE watch Be gUArded bY clienT
 tests terminate
<jimbaker > hazmat,havin g t hewa tchcb d epend on somea pp s tate definitely is wor king,  a s  you su ggest ed
<jim b ak e r > h az ma t,bu t  m aybei c an tryone more t ack  h ere - have t h etest on ap p s tate beforeeac h watc hset u p too 
<_ mup_>  ensem b le/exp ose-provi si o n-serv i ce-hier a r ch y r2 94 committed by j i m. b aker@canonical .com
< _m u p_ > Rem ove d unused c od e, co m ments
< j im b a k er> hazmat, no, t hat doesn't wor k
 * n ie mey e r brea ks
<j im b ake r> hazmat,mayb e what'sgoingo n herei s the f ollowi ng:  te st t e ar do wnoc c urs ;  a s p a rtof that,  t he  zk t reei s d elet ed;  but  this  triggers a w atc h on exp osedflag(bec au se it  has b een e xp osed, and in asepa rate node  th an  th etopol o gy)
<h azm at>  jimbak er, the tes ts a r esupposed to closeth e cl ient, an d open  a  n e w client  t o t eard o wn th e tr e e<jimbake r> the n  t he  watchru ns, bu tthe  cl ienti s al readydisconne cted< hazmat> closin g  the first cl i en t ,  s h utsd own  extant wat ches <jim bake r >haz m at, o k, th at th e ory doesn't work th en  :)
<h azmat > jimbaker, y ou might w a n t  to veri fy y o ur tests are inhe ritin g from the state te st ba se which  has this b ehavior<ji mba ker > h a z ma t, yes it is: c lass  A gentTes tBa se(Stat eTe stB ase ).. .<jimbaker > hazmat ,so  i  w ond er if this arg ue s f or  re insta t ing th e tes t on  c li e nt. connect e di n  the  w at ch.. . p ut tingit t h ere , i loo ped > 100 0 t i mes,  a twhich p oint i contro l- c
<jimbake r>  i' m cont r o lling th e callback on the agent (a newboo leanagen t._runnin g),  but t hew atch i tselfdoesn 't  ha v e  acce s s  b efo re  it does e x i sts _and_ wa tch<hazmat > jimbaker, that
< h azm at> er.. that 'sfine b yme< ji m bak er >  ha z m at, yes, i know . i thinkih av e spent ea s ily  a  number  of day s loo k ing atthis ques tion rais ed  byn i eme yer  on tw o linesof code < jimba k er > sotha t's al lgoo d, ithinkw e h ave a  goodan swer f or wh yit's nec essary, and the best pa tternto wr ite  code
<ji mba k er>  hazmat,1) h ave the wa tch  be  guar ded by cl ient 
 tests_terminate
<jimbaker> hazmat,_having the watch cb_depend on_some_app state_definitely_is working, as_you suggested
<jimbaker> hazmat,_but maybe i can_try one more_tack_here - have the test on app state before each watch setup too
<_mup_> ensemble/expose-provision-service-hierarchy_r294_committed by_jim.baker@canonical.com
<_mup_>_Removed_unused code, comments
<jimbaker> hazmat, no,_that doesn't work
 * niemeyer_breaks
<jimbaker> hazmat,_maybe what's going on here is the following:_test_teardown occurs; as_part of that, the zk tree is deleted; but_this triggers a watch on exposed_flag (because it_has_been_exposed, and in a_separate node than the topology)
<hazmat> jimbaker,_the tests are supposed to close_the client, and open  a new_client to tear down the tree
<jimbaker>_then the watch runs, but_the client_is already disconnected
<hazmat> closing the_first client, shutsdown_extant watches
<jimbaker>_hazmat, ok, that_theory doesn't work then :)
<hazmat> jimbaker,_you might want_to verify your tests are inheriting_from_the state test_base_which_has this_behavior
<jimbaker> hazmat, yes_it_is: class_AgentTestBase(StateTestBase)...
<jimbaker>_hazmat, so i wonder if this_argues_for reinstating the test on client.connected in_the watch... putting it_there,_i looped > 1000_times, at which point i_control-c
<jimbaker> i'm controlling the callback on_the agent_(a new_boolean agent._running), but the watch itself doesn't have access before it_does exists_and_watch
<hazmat> jimbaker, that
<hazmat> er.. that's_fine by me
<jimbaker> hazmat,_yes, i_know._i think i_have_spent easily_a number of days looking at this_question raised_by niemeyer  on two lines_of code 
<jimbaker> so_that's_all good, i think we have_a good answer for why it's_necessary, and the best pattern_to_write_code
<jimbaker> hazmat, 1) have the_watch be guarded by client