/srv/irclogs.ubuntu.com/2012/05/11/#launchpad-yellow.txt

gary_posterargh, again12:10
gary_posterbac frankban sorry, lost track of time.  I'm going to try and get video working.  we'll talk in 5 minutes (12:15 UTC)   one way or the other12:11
bacok12:12
gary_postergmb if you see this, please kick SpamapS about the charm packaging symlinks and python toolbox packaging12:18
frankbanbac: sorry I've closed firefox, you were tellenig me something, I am back in goldenhorde12:28
bacfrankban: ok, let's pair in about 10 minutes.  i'll share a screen using benji's old method12:29
frankbanok12:29
gary_posterfrankban:13:28
gary_poster<flacoste> gary_poster: nah, we always contribute patches upstream on their license terms13:28
gary_poster<flacoste> gary_poster: so this is fin13:28
gary_postere13:28
gary_posterI will unblock your card :-)13:28
frankbancool gary_poster, so LGPL13:28
gary_posterright, frankban13:28
bacgary_poster: yay!14:09
gary_posterbac, ?14:10
bacgary_poster: frankban and i figured out what was going on.  wadl generation caches on a class level dictionary so that is what was breaking test isolation14:10
gary_posterah!  cool.  So you have to...stash the cache and put it back?14:11
bacso test that generate wadl need to clear the cache at the end14:11
gary_posterah ok14:11
bacyou think, or just clear?14:11
gary_postergenerating the cache is expensive, I think14:11
gary_postercould be wrong14:11
gary_postermaybe time the two approaches14:11
bacno, it is very expensive14:11
gary_posterclearing would be nicer14:11
bacbut do we want to keep it between tests?14:12
gary_posterbut if you can just put it back and save a couple of minutes in the test...how long does it take?14:12
gary_posterwe already do keep it between tests14:12
gary_posterif we didn't we'd be paying the cost for any of our tests like this14:12
gary_posters/any/all/14:12
bacwell the problem is recognizing the tests that will be harmed by using a cached wadl that doesn't represent their view of the world14:13
gary_postersure.14:14
gary_posterbut...in either case14:14
gary_postera well behaved test will need to either explicitly clear the cache14:14
gary_posteror reset the previous contents14:15
gary_posterif we put in automation to try to warn test writers (and I'm not quite sure how we would do that unless we stuff it in a shared base testcase), then why can't we put automation to always stash the contents on setup and reinstate on teardown?14:16
bacbut if every test sets aside the cache in a setup and restores it in a teardown then none of those tests are using the cache and gaining no benefit from it14:22
baci'm actually pretty curious now as to why using the cached wadl breaks this test.  the wadl generation looks pretty innocuous14:26
gary_posterbac, no, that's not my idea14:36
gary_posteridea: in setUp, you make a copy of the cache14:36
gary_posterin tearDown, you reinstate that copy14:36
bacright14:36
gary_posterevery test gets a new, clean copy of the cache14:36
gary_posteralready populated14:37
bacbut who generates the cache?14:37
gary_posteryeah, was thinking about that :-)14:37
bacif testA generates the cache, but in teardown replaces it with what he found at the beginning, then it is reset to {}14:37
baci'm currently looking at the difference in the wadl between the cached and newly generated to see if i can tell why it is causing the failure14:38
gary_postersetUp could look on a local base class testcase attribute for the cache.  If it does not exist, it clears out the wadl cache and forces it to be generated (I think there's an explicit call for that IIRC)14:40
gary_posterit then gets the generated code.14:40
gary_postercache I mean14:40
gary_posterOTOH if the local version exists, it puts a copy in the cache.14:40
gary_postereh, I dunno.14:40
gary_posterdifference: doesn't it explicitly specify a different file to load in that test?14:41
gary_posterbeen a while since I looked at it14:41
frankbanbac, gary_poster: I know nothing about how wadl is generated, but, could it be the wadl version? we have devel, beta and 1.014:42
bacfrankban: all three versions are cached and used based on version14:42
frankbanbac: hum...14:42
gary_posteryeah14:43
bacgary_poster, frankban: so the difference between the old and new wadl is simply https vs http14:52
gary_posterhuh14:52
bacso the cached version has https URL, which cause the api tests to fail with 'connection refused' b/c they are listening for http connections14:53
gary_posterand in general--outside of tests--they are supposed to have https urls if I read the code correctly14:55
frankbantest_wadl_generation seems to be the only test that uses generate_wadl, the latter calls _generate_web_service_root that do:14:58
frankbandoes:14:58
frankban# Since we want HTTPS URLs we have to munge the request URL.14:58
frankbanurl = url.replace('http://', 'https://')14:58
frankbangary_poster, bac: we could just add a secure=True argument to generate_wadl and _generate_web_service_root and then call generate_wadl(version, secure=False) in test_wadl...15:02
gary_posterI s'pose, but in general we seem to have code that is generating a test-friendly wadl cache somewhere15:03
gary_posterthat code might change15:03
gary_posterif it does, we'd want that change too15:04
gary_posterwe could try to figure out that mechanism15:04
gary_posterand comment it or hook into it or something15:04
gary_posterso as to make that approach more reliable15:04
gary_posterfor the future15:04
gary_posteror so as to figure out another similar solution15:04
gary_posterutilities/create-lp-wadl-and-apidoc.py ...15:05
gary_posterwhich has no https->http code I see...15:07
gary_posterand looking at the wadl files in my filesystem, they are https too...15:09
gary_posterso who is fixing up https -> http?15:09
gary_posterfor the tests?15:09
baci think _generate_web_service_root  as frankban pointed out above15:10
gary_posterbac, no, the other way around15:12
gary_posterbac, you said that our testing cache has http, right15:12
gary_posterand after we make this call, the urls are https15:12
bacyes, i was backwards15:13
gary_posterwhich time? :-)15:13
gary_posterso, it starts out https15:13
gary_posterand after that test it is http?15:13
bactest_wadl via generate_wadl generated https15:14
frankbangary_poster: I think after test_wadl it remains https, and it is cached15:14
baci don't know who makes the http version used by the api tests15:14
gary_posterright15:14
gary_posterthat was my question15:15
frankbangary_poster, bac: there is the possibility that the cached http version is created by the first test that exercises the api15:15
gary_posterI believe that is the case--oh!15:16
bacyes15:17
gary_posterright, I forgot about that.  So, that means that initially there is no reading of the wadl files15:17
gary_posterthen we produce the wadl files, using generate_wadl, which is done in such a way as to enforce https15:17
frankbanmy suggestion was like: if we can establish that test_wadl is the only test that uses https, we can switch that test to use http instead, so that the cached wadl is valid for all tests15:17
gary_posterright, I followed that.  My concern was that other code may want other changes for tests.  But, generate_wadl appears to be the only official entry point for this.15:18
bacnot wadl files, but in-memory cached wadl15:19
gary_posteryes, good correction, thanks15:19
baclaunchpadlib_for defines the service_root to be 'http://api.launchpad.dev/'15:21
bacso any test using that part of testing/webservice will get http URLs into the cache15:21
bacunless it is already populated15:21
gary_posterok, I feel like you two have been standing there with the full undestanding all along. :-)  Mm, so bac's suggestion was clearing out the cache after the test, and frankban's suggestion is to make the test produce http.  Um, I'm fine with you all deciding.  I lean more towards the "get rid of the stuff we generated in this test" approach rather than the "generate stuff in this test that we an use later," but I'm h15:22
gary_posterappy to let you all decide.15:22
bacso if our normal mechanism properly generates http and only test_wadl is generating https, then i think we should either fix it to generate http or clear the cache when it is done15:22
bacfrankban's solution is good in that it preserves the cache15:23
bacfrankban's solution is bad in that caching is bad for test isolation15:23
frankbanI agree15:25
frankbananother similar solution (with the same pros and cons) is to change _generate_web_service_root to switch http/https only if the version is not "devel", assuming that other tests use 'devel'15:28
baci'm happy in that we now *fully* understand this hateful problem, so any solution is good.15:30
bachere is what i propose:  http://pastebin.ubuntu.com/981864/15:31
bacif test_wadl is the first wadl generator then there will be repeated effort but in all other situations there is no waste15:32
frankbanbac: I like that only the test code is changed (using your solution), +115:39
bacyeah, that appealed to me too15:40
bacgary_poster: there are no other reviewers (but me), so if you have time, https://code.launchpad.net/~bac/launchpad/bug-996773-2/+merge/10549915:58
* bac ->lunch15:58
gary_postersure bac15:59
gary_posterfrankban, call now or next week?15:59
frankbangary_poster: now is ok if you are have time16:00
gary_postercool frankban.  let's go to https://talkgadget.google.com/hangouts/_/extras/canonical.com/goldenhordeoneonone16:01
gary_postersorry bac17:33
gary_posterwas on call and then had lunch17:33
gary_posterbut sinzui approved, as I'm sure you saw17:33
gary_posterbac, hey19:34
gary_posteryou around for a quick call?19:35
bacoh yeah19:35
bacgood thing you fixed your calendar.  :)19:35
bacgary_poster: in oneonone19:36
gary_posterbac, I got a test error on the data center machine which looks like the old bzr whoami problem.  Do we have to do something in the system to prevent these?20:23
gary_poster v20:23
gary_posterhttp://pastebin.ubuntu.com/982322/20:23
gary_posterAh, yeah I think I remember20:24
bacno, we rolled back the /etc/mailname approach20:24
bacand added a 'bzr whoami' to the failing test20:25
bacso the test should not fail20:25
gary_posteroh20:26
gary_postermaybe is this a different failing test, bac?20:26
gary_posterand we just need to add the same fix?20:26
bacgary_poster: this just posted http://www.youtube.com/watch?v=WAlhLz3lNNs&feature=uploademail  "Juju Charm Best Practices"20:26
baci wonder if any of ours made the cut20:26
gary_posterwell, python shelltoolbox must not have :-(20:28
bacgary_poster: that test does not match what i see in trunk20:29
bace.g. line 187, where the failure occurs is not the same20:29
bacdo you have a recent branch?20:29
bacin trunk, the whoami fix is at line 17920:30
gary_posteroh this is r1513120:30
bac< 1523620:30
gary_posterah!20:31
gary_posterok20:31
gary_posterthanks bac.  I thought something was already updating the branch20:37
baci have the UDS session playing in the background on my tv20:37
baci keep hearing "best practices" and "promulgate" being used way too much20:37
gary_posterheh20:38
gary_posterbac, I have it in the background too.  AFAICT they are not sharing best practices but just randomly saying blue sky stuff. oops20:38
bacyeah, well20:40
bacyou know, if we're supposed to plugging in more company-wide, we really need to be at UDS20:40
bacgary_poster: so far i cannot reproduce bug 99804020:44
_mup_Bug #998040: lp.codehosting.tests.test_bzrutils.TestGetBranchStackedOnURL.testGetBranchStackedOnUrlNotStacked(RemoteBranchFormat-v2) fails rarely/intermittently in parallel tests <paralleltest> <Launchpad itself:In Progress by bac> < https://launchpad.net/bugs/998040 >20:44
gary_posterbac, agree about UDS20:45
bacrunning original worker set repeatedly now20:45
gary_posterno idea about repro :-/20:45
bacok20:45
gary_posterI just turned off the UDS session.  kind of annoying. :-P20:46

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!