Closed
Bug 1731705
Opened 4 years ago
Closed 4 years ago
Intermittent testing/mozbase/mozproxy/tests/test_proxy.py::test_mitm TEST-UNEXPECTED-FAIL
Categories
(Testing :: Mozbase, defect, P5)
Testing
Mozbase
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: intermittent-bug-filer, Unassigned)
Details
(Keywords: intermittent-failure)
Filed by: ncsoregi [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=352151543&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/Et2j-kpdTLmyWKG3AdwI-A/runs/0/artifacts/public/logs/live_backing.log
[task 2021-09-20T23:05:01.184Z] 0:49.22 ============================= test session starts ==============================
[task 2021-09-20T23:05:01.184Z] 0:49.22 platform darwin -- Python 3.7.4, pytest-3.6.2, py-1.10.0, pluggy-0.6.0 -- /Users/cltbld/tasks/task_1632178828/checkouts/gecko/obj-x86_64-apple-darwin18.6.0/_virtualenvs/python-test/bin/python
[task 2021-09-20T23:05:01.184Z] 0:49.22 rootdir: /Users/cltbld/tasks/task_1632178828/checkouts/gecko, inifile: /Users/cltbld/tasks/task_1632178828/checkouts/gecko/config/mozunit/mozunit/pytest.ini
[task 2021-09-20T23:05:01.184Z] 0:49.22 collecting ... collected 4 items
[task 2021-09-20T23:05:01.184Z] 0:49.22
[task 2021-09-20T23:05:01.187Z] 0:49.22 testing/mozbase/mozproxy/tests/test_proxy.py::test_mitm_check_proxy PASSED
[task 2021-09-20T23:05:01.191Z] 0:49.22 testing/mozbase/mozproxy/tests/test_proxy.py::test_mitm TEST-UNEXPECTED-FAIL
[task 2021-09-20T23:05:01.191Z] 0:49.22 testing/mozbase/mozproxy/tests/test_proxy.py::test_playback_setup_failed PASSED
[task 2021-09-20T23:05:01.191Z] 0:49.22 testing/mozbase/mozproxy/tests/test_proxy.py::test_mitm_with_retry PASSED
[task 2021-09-20T23:05:01.191Z] 0:49.22
[task 2021-09-20T23:05:01.191Z] 0:49.22 =================================== FAILURES ===================================
[task 2021-09-20T23:05:01.191Z] 0:49.22 __________________________________ test_mitm ___________________________________
[task 2021-09-20T23:05:01.191Z] 0:49.22
[task 2021-09-20T23:05:01.191Z] 0:49.22 args = (<MagicMock name='check_proxy' id='4339259600'>,)
[task 2021-09-20T23:05:01.191Z] 0:49.22 pageset_name = '/Users/cltbld/tasks/task_1632178828/checkouts/gecko/testing/mozbase/mozproxy/tests/files/mitm5-linux-firefox-amazon.manifest'
[task 2021-09-20T23:05:01.191Z] 0:49.22 config = {'app': 'firefox', 'binary': 'firefox', 'host': 'example.com', 'obj_path': '/var/folders/9z/5yxm0wfn6hqd3df1kdn43zfw000017/T/tmpppeaag43', ...}
[task 2021-09-20T23:05:01.191Z] 0:49.22 obj_path = '/var/folders/9z/5yxm0wfn6hqd3df1kdn43zfw000017/T/tmpppeaag43'
[task 2021-09-20T23:05:01.191Z] 0:49.22
[task 2021-09-20T23:05:01.191Z] 0:49.22 @mock.patch("mozproxy.backends.mitm.Mitmproxy.check_proxy")
[task 2021-09-20T23:05:01.191Z] 0:49.22 @mock.patch("mozproxy.backends.mitm.mitm.ProcessHandler", new=Process)
[task 2021-09-20T23:05:01.191Z] 0:49.22 @mock.patch("mozproxy.utils.ProcessHandler", new=Process)
[task 2021-09-20T23:05:01.191Z] 0:49.22 @mock.patch("os.kill", new=kill)
[task 2021-09-20T23:05:01.191Z] 0:49.22 def test_mitm(*args):
[task 2021-09-20T23:05:01.191Z] 0:49.22 pageset_name = os.path.join(here, "files", "mitm5-linux-firefox-amazon.manifest")
[task 2021-09-20T23:05:01.191Z] 0:49.22
[task 2021-09-20T23:05:01.191Z] 0:49.22 config = {
[task 2021-09-20T23:05:01.191Z] 0:49.22 "playback_tool": "mitmproxy",
[task 2021-09-20T23:05:01.191Z] 0:49.22 "playback_files": [pageset_name],
[task 2021-09-20T23:05:01.191Z] 0:49.22 "playback_version": "5.1.1",
[task 2021-09-20T23:05:01.191Z] 0:49.22 "platform": mozinfo.os,
[task 2021-09-20T23:05:01.191Z] 0:49.22 "run_local": True,
[task 2021-09-20T23:05:01.191Z] 0:49.22 "binary": "firefox",
[task 2021-09-20T23:05:01.191Z] 0:49.22 "app": "firefox",
[task 2021-09-20T23:05:01.191Z] 0:49.22 "host": "example.com",
[task 2021-09-20T23:05:01.191Z] 0:49.22 }
[task 2021-09-20T23:05:01.191Z] 0:49.22
[task 2021-09-20T23:05:01.191Z] 0:49.22 with tempdir() as obj_path:
[task 2021-09-20T23:05:01.191Z] 0:49.22 config["obj_path"] = obj_path
[task 2021-09-20T23:05:01.191Z] 0:49.22 playback = get_playback(config)
[task 2021-09-20T23:05:01.191Z] 0:49.22 assert playback is not None
[task 2021-09-20T23:05:01.191Z] 0:49.22 try:
[task 2021-09-20T23:05:01.191Z] 0:49.22 > playback.start()
[task 2021-09-20T23:05:01.191Z] 0:49.22
[task 2021-09-20T23:05:01.191Z] 0:49.22 testing/mozbase/mozproxy/tests/test_proxy.py:121:
[task 2021-09-20T23:05:01.191Z] 0:49.22 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2021-09-20T23:05:01.191Z] 0:49.22 testing/mozbase/mozproxy/mozproxy/backends/mitm/mitm.py:252: in start
[task 2021-09-20T23:05:01.191Z] 0:49.22 self.setup()
[task 2021-09-20T23:05:01.191Z] 0:49.22 testing/mozbase/mozproxy/mozproxy/backends/mitm/desktop.py:70: in setup
[task 2021-09-20T23:05:01.191Z] 0:49.22 self.install_mitmproxy_cert(self.browser_path)
[task 2021-09-20T23:05:01.191Z] 0:49.23 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2021-09-20T23:05:01.191Z] 0:49.23
[task 2021-09-20T23:05:01.191Z] 0:49.23 self = <mozproxy.backends.mitm.desktop.MitmproxyDesktop object at 0x102af1a50>
[task 2021-09-20T23:05:01.191Z] 0:49.23 browser_path = 'firefox'
[task 2021-09-20T23:05:01.191Z] 0:49.23
[task 2021-09-20T23:05:01.191Z] 0:49.23 def install_mitmproxy_cert(self, browser_path):
[task 2021-09-20T23:05:01.191Z] 0:49.23 """Install the CA certificate generated by mitmproxy, into Firefox
[task 2021-09-20T23:05:01.191Z] 0:49.23 1. Create a dir called 'distribution' in the same directory as the Firefox executable
[task 2021-09-20T23:05:01.191Z] 0:49.23 2. Create the policies.json file inside that folder; which points to the certificate
[task 2021-09-20T23:05:01.191Z] 0:49.23 location, and turns on the the browser proxy settings
[task 2021-09-20T23:05:01.191Z] 0:49.23 """
[task 2021-09-20T23:05:01.191Z] 0:49.23 LOG.info("Installing mitmproxy CA certficate into Firefox")
[task 2021-09-20T23:05:01.191Z] 0:49.23
[task 2021-09-20T23:05:01.191Z] 0:49.23 # browser_path is the exe, we want the folder
[task 2021-09-20T23:05:01.191Z] 0:49.23 self.policies_dir = os.path.dirname(browser_path)
[task 2021-09-20T23:05:01.192Z] 0:49.23 # on macosx we need to remove the last folders 'MacOS'
[task 2021-09-20T23:05:01.192Z] 0:49.23 # and the policies json needs to go in ../Content/Resources/
[task 2021-09-20T23:05:01.192Z] 0:49.23 if "mac" in self.config["platform"]:
[task 2021-09-20T23:05:01.192Z] 0:49.23 self.policies_dir = os.path.join(self.policies_dir[:-6], "Resources")
[task 2021-09-20T23:05:01.192Z] 0:49.23 # for all platforms the policies json goes in a 'distribution' dir
[task 2021-09-20T23:05:01.192Z] 0:49.23 self.policies_dir = os.path.join(self.policies_dir, "distribution")
[task 2021-09-20T23:05:01.192Z] 0:49.23
[task 2021-09-20T23:05:01.192Z] 0:49.23 self.cert_path = DEFAULT_CERT_PATH
[task 2021-09-20T23:05:01.192Z] 0:49.23 # for windows only
[task 2021-09-20T23:05:01.192Z] 0:49.23 if mozinfo.os == "win":
[task 2021-09-20T23:05:01.192Z] 0:49.23 self.cert_path = self.cert_path.replace("\\", "\\\\")
[task 2021-09-20T23:05:01.194Z] 0:49.23
[task 2021-09-20T23:05:01.194Z] 0:49.23 if not os.path.exists(self.policies_dir):
[task 2021-09-20T23:05:01.194Z] 0:49.23 LOG.info("creating folder: %s" % self.policies_dir)
[task 2021-09-20T23:05:01.194Z] 0:49.23 os.makedirs(self.policies_dir)
[task 2021-09-20T23:05:01.194Z] 0:49.23 else:
[task 2021-09-20T23:05:01.194Z] 0:49.23 LOG.info("folder already exists: %s" % self.policies_dir)
[task 2021-09-20T23:05:01.194Z] 0:49.23
[task 2021-09-20T23:05:01.194Z] 0:49.23 self.write_policies_json(
[task 2021-09-20T23:05:01.194Z] 0:49.23 self.policies_dir,
[task 2021-09-20T23:05:01.194Z] 0:49.23 policies_content=POLICIES_CONTENT_ON
[task 2021-09-20T23:05:01.194Z] 0:49.23 % {"cert": self.cert_path, "host": self.host, "port": self.port},
[task 2021-09-20T23:05:01.194Z] 0:49.23 )
[task 2021-09-20T23:05:01.194Z] 0:49.23
[task 2021-09-20T23:05:01.194Z] 0:49.23 # cannot continue if failed to add CA cert to Firefox, need to check
[task 2021-09-20T23:05:01.194Z] 0:49.23 if not self.is_mitmproxy_cert_installed():
[task 2021-09-20T23:05:01.194Z] 0:49.23 LOG.error(
[task 2021-09-20T23:05:01.194Z] 0:49.23 "Aborting: failed to install mitmproxy CA cert into Firefox desktop"
[task 2021-09-20T23:05:01.194Z] 0:49.23 )
[task 2021-09-20T23:05:01.194Z] 0:49.23 self.stop_mitmproxy_playback()
[task 2021-09-20T23:05:01.194Z] 0:49.23 > sys.exit()
[task 2021-09-20T23:05:01.194Z] 0:49.23 E SystemExit
[task 2021-09-20T23:05:01.194Z] 0:49.23
[task 2021-09-20T23:05:01.194Z] 0:49.23 testing/mozbase/mozproxy/mozproxy/backends/mitm/desktop.py:112: SystemExit
[task 2021-09-20T23:05:01.194Z] 0:49.23 ----------------------------- Captured stdout call -----------------------------
| Comment hidden (Intermittent Failures Robot) |
Comment 2•4 years ago
|
||
https://wiki.mozilla.org/Bug_Triage#Intermittent_Test_Failure_Cleanup
For more information, please visit auto_nag documentation.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•