GTG

Activity log for bug #618311

Date Who What changed Old value New value Message
2010-08-15 18:06:34 Thibault Févry bug added bug
2010-08-15 18:06:34 Thibault Févry attachment added This is not a patch file, because those generated by bzr doesn't save removing of spaces... https://bugs.launchpad.net/bugs/618311/+attachment/1492070/+files/test_datastore.py
2010-08-15 18:08:16 Thibault Févry attachment added diff.txt https://bugs.launchpad.net/gtg/+bug/618311/+attachment/1492072/+files/diff.txt
2010-08-15 18:28:08 Thibault Févry gtg: assignee Thibault Fevry (thibaultfevry)
2010-08-15 18:38:11 Thibault Févry description [Running ./run_tests from repo] This error won't happend all the time, actually just 1/20 of the time. Why this happens ? Because in the code, we have at a certain point this : for temp in xrange(1, int(random.random() * 20)): backend.fake_add_random_task() The problem here is that if int(random.random() * 20) is 1. There will be no tasks. [ Same behaviour as : i = 0 while i < int(random()*2): print "1" That will only print "1" once in every 2 runs. This makes that 1/20 times, this test result isn't correct. Also in the patch, I also made some other improvements in the code of that module. (Using randint(start, limit) instead of int(random.random()*limit) Hope the patch looks fine, I'm not very good in publishing my work. (I don't use patches or bazaar very often.)  [Running ./run_tests from repo] This error won't happend all the time, actually just 1/20 of the time.  Why this happens ?  Because in the code, we have at a certain point this : for temp in xrange(1, int(random.random() * 20)):     backend.fake_add_random_task()  The problem here is that if int(random.random() * 20) is 1. There will be no tasks. [ Same behaviour as : i = 0 while i < int(random()*2):     print "1" That will only print "1" once in every 2 runs. This makes that 1/20 times, this test result isn't correct. Also in the patch, I also made some other improvements in the code of that module. (Using randint(start, limit) instead of int(random.random()*limit) and removed 25 of 26 pep8 errors. I also changed one time.sleep(5) to time.sleep(2), it's enough time. [This makes a 3s speedup when running the test suite.]  Hope the patch looks fine, I'm not very good in publishing my work. (I don't use patches or bazaar very often.)
2010-08-15 19:09:02 Luca Invernizzi gtg: status New In Progress
2010-08-15 19:14:16 Luca Invernizzi gtg: status In Progress Fix Committed
2010-08-15 19:14:27 Luca Invernizzi gtg: importance Undecided Low
2010-08-15 19:14:27 Luca Invernizzi gtg: milestone 0.3
2010-08-15 19:15:33 Launchpad Janitor branch linked lp:gtg
2011-08-09 09:29:00 Lionel Dricot gtg: milestone 0.3 0.2.9
2012-02-13 13:27:51 Izidor Matušov gtg: status Fix Committed Fix Released