Closed Bug 1581224 Opened 2 years ago Closed 2 years ago

mach - enable python3 for uuid

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox72 fixed)

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: egao, Assigned: egao)

References

Details

Attachments

(1 file)

mach uuid is another easy migration candidate for python3.

Assignee: nobody → egao

With the patch applied, it looks like the return code is 1 for some reason:

[task 2019-10-17T00:55:57.575Z]  0:43.12 ___________________________ test_registrar_dispatch ____________________________
[task 2019-10-17T00:55:57.576Z]  0:43.12 
[task 2019-10-17T00:55:57.576Z]  0:43.12 run_mach = <function run_mach.<locals>.run at 0x7f62bb7f59d8>
[task 2019-10-17T00:55:57.576Z]  0:43.12 
[task 2019-10-17T00:55:57.576Z]  0:43.12     def test_registrar_dispatch(run_mach):
[task 2019-10-17T00:55:57.576Z]  0:43.12         # Use --exec-file so this script can use Registrar.dispatch to dispatch a mach command
[task 2019-10-17T00:55:57.576Z]  0:43.12         # from within the same interpreter as the `mach python` command.
[task 2019-10-17T00:55:57.577Z]  0:43.12         data = run_mach('python', '--exec-file',
[task 2019-10-17T00:55:57.577Z]  0:43.12 >                       os.path.join(os.path.dirname(__file__), 'registrar_dispatch.py'))
[task 2019-10-17T00:55:57.577Z]  0:43.12 
[task 2019-10-17T00:55:57.577Z]  0:43.12 python/mach/mach/test/test_telemetry.py:152:
[task 2019-10-17T00:55:57.577Z]  0:43.12 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2019-10-17T00:55:57.578Z]  0:43.12 python/mach/mach/test/test_telemetry.py:46: in run
[task 2019-10-17T00:55:57.578Z]  0:43.12     **kwargs)
[task 2019-10-17T00:55:57.578Z]  0:43.12 /usr/lib/python3.5/subprocess.py:626: in check_output
[task 2019-10-17T00:55:57.578Z]  0:43.12     **kwargs).stdout
[task 2019-10-17T00:55:57.579Z]  0:43.12 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2019-10-17T00:55:57.579Z]  0:43.12 
[task 2019-10-17T00:55:57.579Z]  0:43.12 input = None, timeout = None, check = True
[task 2019-10-17T00:55:57.579Z]  0:43.12 popenargs = (['/builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/gecko-QUm8IANb-3/bin/python', '/builds/worker/c...s/gecko/mach', 'python', '--exec-file', '/builds/worker/checkouts/gecko/python/mach/mach/test/registrar_dispatch.py'],)
[task 2019-10-17T00:55:57.580Z]  0:43.12 kwargs = {'env': {'PYTEST_ADDOPTS': '', 'TASKCLUSTER_WORKER_TYPE': 'gecko-t-linux-xlarge', 'SHELL': '/bin/bash', 'GECKO_HEAD_REPOSITORY': 'https://hg.mozilla.org/try', ...}, 'stderr': -2, 'stdout': -1}
[task 2019-10-17T00:55:57.580Z]  0:43.12 process = <subprocess.Popen object at 0x7f62bb279a20>
[task 2019-10-17T00:55:57.580Z]  0:43.12 stdout = b'1882ff87-a2a7-4344-a066-f5c429928119\n\n{ 0x1882ff87, 0xa2a7, 0x4344, \\\n  { 0xa0, 0x66, 0xf5, 0xc4, 0x29, 0x92, 0x...{\'client_id\': client_id}, f)\n  File "/usr/lib/python3.5/json/__init__.py", line 179, in dump\n    fp.write(chunk)\n'
[task 2019-10-17T00:55:57.580Z]  0:43.12 stderr = None, retcode = 1
[task 2019-10-17T00:55:57.580Z]  0:43.12 
[task 2019-10-17T00:55:57.580Z]  0:43.12     def run(*popenargs, input=None, timeout=None, check=False, **kwargs):
[task 2019-10-17T00:55:57.580Z]  0:43.12         """Run command with arguments and return a CompletedProcess instance.
[task 2019-10-17T00:55:57.581Z]  0:43.12 
[task 2019-10-17T00:55:57.581Z]  0:43.12         The returned instance will have attributes args, returncode, stdout and
[task 2019-10-17T00:55:57.581Z]  0:43.12         stderr. By default, stdout and stderr are not captured, and those attributes
[task 2019-10-17T00:55:57.581Z]  0:43.12         will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
[task 2019-10-17T00:55:57.581Z]  0:43.12 
[task 2019-10-17T00:55:57.581Z]  0:43.12         If check is True and the exit code was non-zero, it raises a
[task 2019-10-17T00:55:57.581Z]  0:43.12         CalledProcessError. The CalledProcessError object will have the return code
[task 2019-10-17T00:55:57.582Z]  0:43.12         in the returncode attribute, and output & stderr attributes if those streams
[task 2019-10-17T00:55:57.582Z]  0:43.12         were captured.
[task 2019-10-17T00:55:57.582Z]  0:43.12 
[task 2019-10-17T00:55:57.582Z]  0:43.12         If timeout is given, and the process takes too long, a TimeoutExpired
[task 2019-10-17T00:55:57.582Z]  0:43.12         exception will be raised.
[task 2019-10-17T00:55:57.582Z]  0:43.12 
[task 2019-10-17T00:55:57.583Z]  0:43.12         There is an optional argument "input", allowing you to
[task 2019-10-17T00:55:57.583Z]  0:43.12         pass a string to the subprocess's stdin.  If you use this argument
[task 2019-10-17T00:55:57.583Z]  0:43.12         you may not also use the Popen constructor's "stdin" argument, as
[task 2019-10-17T00:55:57.584Z]  0:43.12         it will be used internally.
[task 2019-10-17T00:55:57.584Z]  0:43.13 
[task 2019-10-17T00:55:57.584Z]  0:43.13         The other arguments are the same as for the Popen constructor.
[task 2019-10-17T00:55:57.585Z]  0:43.13 
[task 2019-10-17T00:55:57.585Z]  0:43.13         If universal_newlines=True is passed, the "input" argument must be a
[task 2019-10-17T00:55:57.585Z]  0:43.13         string and stdout/stderr in the returned object will be strings rather than
[task 2019-10-17T00:55:57.586Z]  0:43.13         bytes.
[task 2019-10-17T00:55:57.586Z]  0:43.13         """
[task 2019-10-17T00:55:57.586Z]  0:43.13         if input is not None:
[task 2019-10-17T00:55:57.586Z]  0:43.13             if 'stdin' in kwargs:
[task 2019-10-17T00:55:57.587Z]  0:43.13                 raise ValueError('stdin and input arguments may not both be used.')
[task 2019-10-17T00:55:57.587Z]  0:43.13             kwargs['stdin'] = PIPE
[task 2019-10-17T00:55:57.587Z]  0:43.13 
[task 2019-10-17T00:55:57.587Z]  0:43.13         with Popen(*popenargs, **kwargs) as process:
[task 2019-10-17T00:55:57.587Z]  0:43.13             try:
[task 2019-10-17T00:55:57.588Z]  0:43.13                 stdout, stderr = process.communicate(input, timeout=timeout)
[task 2019-10-17T00:55:57.588Z]  0:43.13             except TimeoutExpired:
[task 2019-10-17T00:55:57.588Z]  0:43.13                 process.kill()
[task 2019-10-17T00:55:57.588Z]  0:43.13                 stdout, stderr = process.communicate()
[task 2019-10-17T00:55:57.589Z]  0:43.13                 raise TimeoutExpired(process.args, timeout, output=stdout,
[task 2019-10-17T00:55:57.589Z]  0:43.13                                      stderr=stderr)
[task 2019-10-17T00:55:57.589Z]  0:43.13             except:
[task 2019-10-17T00:55:57.589Z]  0:43.13                 process.kill()
[task 2019-10-17T00:55:57.590Z]  0:43.13                 process.wait()
[task 2019-10-17T00:55:57.590Z]  0:43.13                 raise
[task 2019-10-17T00:55:57.590Z]  0:43.13             retcode = process.poll()
[task 2019-10-17T00:55:57.590Z]  0:43.13             if check and retcode:
[task 2019-10-17T00:55:57.591Z]  0:43.13                 raise CalledProcessError(retcode, process.args,
[task 2019-10-17T00:55:57.591Z]  0:43.13 >                                        output=stdout, stderr=stderr)
[task 2019-10-17T00:55:57.591Z]  0:43.13 E               subprocess.CalledProcessError: Command '['/builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/gecko-QUm8IANb-3/bin/python', '/builds/worker/checkouts/gecko/mach', 'python', '--exec-file', '/builds/worker/checkouts/gecko/python/mach/mach/test/registrar_dispatch.py']' returned non-zero exit status 1
[task 2019-10-17T00:55:57.591Z]  0:43.13 
[task 2019-10-17T00:55:57.591Z]  0:43.13 /usr/lib/python3.5/subprocess.py:708: CalledProcessError

Was able to reproduce this failure locally, but after several runs it no longer returns exit code 1.

Attachment #9092770 - Attachment description: Bug 1581224 - convert mach uuid to run with python3 → Bug 1581224 - convert mach uuid to be compatible with both python2/3
Pushed by egao@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c67e0b10b52f
convert mach uuid to be compatible with both python2/3 r=Callek
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.