Merge ~cjwatson/launchpad:improve-web-browser-layer-handling into launchpad:master
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 7005d66b28d8c690a8c04b8ef2b406504709a04d |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:improve-web-browser-layer-handling |
Merge into: | launchpad:master |
Diff against target: |
136 lines (+41/-12) 4 files modified
lib/lp/testing/__init__.py (+5/-2) lib/lp/testing/html5browser.py (+1/-1) lib/lp/testing/layers.py (+28/-2) lib/lp/testing/tests/test_html5browser.py (+7/-7) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guruprasad | Approve | ||
Review via email: mp+451761@code.launchpad.net |
Commit message
Improve handling of Firefox subprocesses in tests
Description of the change
Firefox is run via Selenium by some test cases. Since it's rather heavyweight, we run it in a layer so that it can be started up and shut down just once for a group of test cases.
I happened to notice recently that Firefox wasn't actually being shut down correctly, and continued to run long after any test cases that used it had finished. This turned out to be because the `YUITestLayer` teardown process was calling `selenium.
In the process, I also noticed that `lp.testing.
I've verified that the process management now works correctly by running `while :; do date; ps xf; sleep 2; echo; done` in parallel with the test suite, and checking both that it uses a common browser instance and that it cleans it up when the relevant layer is torn down.
LGTM 👍