[manifestparser] Add support for Python 3
Categories
(Testing :: Mozbase, enhancement, P3)
Tracking
(firefox74 fixed)
| Tracking | Status | |
|---|---|---|
| firefox74 | --- | fixed |
People
(Reporter: whimboo, Assigned: championshuttler)
References
Details
Attachments
(5 files, 3 obsolete files)
Updated•8 years ago
|
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
| Reporter | ||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Comment 5•7 years ago
|
||
| Reporter | ||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
Comment 10•7 years ago
|
||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
Comment 15•7 years ago
|
||
Comment 16•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Comment 17•7 years ago
|
||
Comment 18•7 years ago
|
||
Comment 19•7 years ago
|
||
Hey :sandeepb are you still interested in working on this patch?
Comment 20•7 years ago
|
||
Hi :davehunt, i am still interested in working on this patch. Been little busy with work.
Going by our last discussion, I have made one of the changes suggested as mentioned here https://phabricator.services.mozilla.com/D3287#166110
I will work on the mentioned reraise issue.
Regarding intermittent failures, i am still unable too find the reason for them to appear occasionally. Could you provide some more pointers to debug this.
Comment 21•7 years ago
|
||
(In reply to Dave Hunt [:davehunt] [he/him] ⌚️UTC from comment #19)
Hey :sandeepb are you still interested in working on this patch?
forgot to clear needinfo.
Comment 22•7 years ago
|
||
Thanks :sandeepb, let us know when you have an update. Regarding the intermittent failures, if I recall correctly these were quite easy for my to reproduce locally just by running the tests multiple times. Are you able to replicate these failures?
Comment 23•7 years ago
|
||
(In reply to Dave Hunt [:davehunt] [he/him] ⌚️UTC from comment #22)
Thanks :sandeepb, let us know when you have an update. Regarding the intermittent failures, if I recall correctly these were quite easy for my to reproduce locally just by running the tests multiple times. Are you able to replicate these failures?
Hi :davehunt, I tried debugging the test_chunking.py for intermittent failures. One problem i identified is with chunk_by_round_robin method which is returning chunks list based on the runtime of last chunk.
Specifically in our case, for the 2nd test we have 4 directories which generates only 3 tests because of directory bar with 0 value. These 3 tests have runtimes of (3,14,81). In chunk_by_round_robin, we are creating manifest set(unordered collection). If the chunk of runtime 3 is processed last, we get only 3 chunks(scenario 1). In other cases, we get 14 and 81 chunks of which only 3 chunks are of tests and remaining are empty lists(scenario 2).
While creating chunks normally, we create an empty chunk for bar as well. Because of this, the runtime_delta of local chunks is 81-0 every time. But when round robin returns only 3 chunks(scenario 1), the runtime_delta of those chunks is 81-3=78 which is less than our normal runtime_delta and thus the test failure.
To rectify this, I want to create max(runtime) of chunks rather than the runtime of last test in chunk_by_round_robin method. Could you please let me know whether that is an appropriate fix or not?
Comment 24•7 years ago
|
||
(In reply to Dave Hunt [:davehunt] [he/him] ⌚️UTC from comment #22)
Thanks :sandeepb, let us know when you have an update. Regarding the intermittent failures, if I recall correctly these were quite easy for my to reproduce locally just by running the tests multiple times. Are you able to replicate these failures?
Hi :davehunt, Please check my earlier comment and suggest a possible solution.
Regarding the second intermittent failure occuring in test_manifestparser.py, I found the reason for it to happen. But i cant pinpoint why it is happening intermittently.
In this case, we are creating ManifestParser Object in test_parent_defaults method in test_manifestparser.py. The parser data is different when the tests are failing. I couldnt identify why the parser object is different on different runs.
Comment 25•7 years ago
|
||
(In reply to Sandeep Bypina [:sandeepb] from comment #23)
(In reply to Dave Hunt [:davehunt] [he/him] ⌚️UTC from comment #22)
Thanks :sandeepb, let us know when you have an update. Regarding the intermittent failures, if I recall correctly these were quite easy for my to reproduce locally just by running the tests multiple times. Are you able to replicate these failures?
Hi :davehunt, I tried debugging the
test_chunking.pyfor intermittent failures. One problem i identified is withchunk_by_round_robinmethod which is returning chunks list based on the runtime of last chunk.Specifically in our case, for the 2nd test we have 4 directories which generates only 3 tests because of directory
barwith 0 value. These 3 tests have runtimes of (3,14,81). Inchunk_by_round_robin, we are creating manifest set(unordered collection). If the chunk of runtime 3 is processed last, we get only 3 chunks(scenario 1). In other cases, we get 14 and 81 chunks of which only 3 chunks are of tests and remaining are empty lists(scenario 2).While creating chunks normally, we create an empty chunk for
baras well. Because of this, the runtime_delta of local chunks is 81-0 every time. But when round robin returns only 3 chunks(scenario 1), the runtime_delta of those chunks is 81-3=78 which is less than our normal runtime_delta and thus the test failure.To rectify this, I want to create
max(runtime)of chunks rather than the runtime of last test inchunk_by_round_robinmethod. Could you please let me know whether that is an appropriate fix or not?
I'm not familiar with this code, perhaps :ahal can help here?
Comment 26•7 years ago
|
||
Hi Sandeep, I think the fix sounds good but I'm having a bit of trouble following the problem. Specifically what is different between python 2/3 that would cause this intermittent?
Could you push your fix to phabricator and flag me for review? I think it would help to see what you are talking about in the code. Thanks!
Comment 27•7 years ago
|
||
(In reply to Andrew Halberstadt [:ahal] from comment #26)
Hi Sandeep, I think the fix sounds good but I'm having a bit of trouble following the problem. Specifically what is different between python 2/3 that would cause this intermittent?
Could you push your fix to phabricator and flag me for review? I think it would help to see what you are talking about in the code. Thanks!
Hi Andrew, I have pushed the fix to phabricator and flagged you. Please take a look at the code and suggest any changes needed.
Thanks.
Comment 28•7 years ago
|
||
Nice investigation! That makes sense, I can see by looking at the old code why this might fail intermittently.
So it's probably blind luck that the python 2 set implementation was iterating over the items in the set consistently. The python 3 implementation must be more likely to iterate in a different order.
I set :davehunt as a blocking reviewer to make sure he's happy with the other changes before proceeding. Thanks very much for figuring this out :)
Updated•6 years ago
|
Comment 29•6 years ago
|
||
championshuttler: are you working on this now?
| Assignee | ||
Comment 30•6 years ago
|
||
Hi Dave, really sorry for the late reply I updated the patch on behalf of Sandeep and later :ahal and me were testing it but its like sometimes the tests are passing and sometimes its not, even sometimes tests are failing for python 2.7 , we did not get any proper reason behind it thats why we had to leave it for future.
@ahal can you please provide more info if you remember something about it.
Thanks
Comment 31•6 years ago
|
||
Sorry, I don't remember what the issue was beyond my comment here:
https://phabricator.services.mozilla.com/D3287#1408363
IIRC Shivam only fixed some lint issues so that we could land the patch (at which point I discovered the test failures). Sandeep, were you still interested in investigating this?
Updated•6 years ago
|
Updated•6 years ago
|
| Assignee | ||
Comment 32•6 years ago
|
||
Updated•6 years ago
|
Comment 33•6 years ago
|
||
Comment 34•6 years ago
|
||
| bugherder | ||
| Reporter | ||
Updated•6 years ago
|
| Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
| Reporter | ||
Comment 35•6 years ago
|
||
Edwin, are you going to push the changes to PyPI?
Comment 36•6 years ago
|
||
Looks like the patch landed successfully.
Next task is to ensure the remaining two tests from https://searchfox.org/mozilla-central/source/testing/mozbase/manifestparser/tests/manifest.ini enabled to run with python3 as well as python2.
Other remaining tasks is to do a pass over all files once the above is complete, to ensure that all problematic sections of code have been addressed to be python2/3 safe. Use 2to3 as reference if unsure.
As a penultimate item - general code style cleanup by applying pep8 and other linters.
Lastly, prior to closing this bug, do a major version bump to indicate some significant work has taken place, and upload to pypi (which I can handle, assuming I have the permission).
Comment 38•6 years ago
•
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #35)
Edwin, are you going to push the changes to PyPI?
I could publish it now, though two tests are still failing on python3 so has been temporarily disabled. I wouldn't consider the work to be done at this state; I'm hoping that we'll be able close this bug out with all work done in a week or two, possibly faster.
Thanks for following up though!
Comment 39•6 years ago
|
||
Comment 40•6 years ago
|
||
This latest patch should fix issues with test_chunking.py, leaving only the test_directory_covert.py as the outstanding item.
Comment 41•6 years ago
|
||
Updated•6 years ago
|
Comment 42•6 years ago
|
||
Comment 43•6 years ago
|
||
| bugherder | ||
Comment 44•6 years ago
|
||
Comment 45•6 years ago
|
||
Once the above patch lands on m-c I believe we are done with the python3 compatibility migration. If so, I will release a new version to pypi with major version bump.
Comment 46•6 years ago
|
||
| bugherder | ||
Comment 47•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 48•6 years ago
|
||
Comment 49•6 years ago
|
||
| bugherder | ||
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 50•6 years ago
|
||
Comment 51•6 years ago
|
||
Comment 52•6 years ago
|
||
| bugherder | ||
Description
•