Closed Bug 1644283 Opened 4 years ago Closed 4 years ago

Perma [tier2] python/mozbuild/mozpack/test/test_files.py::TestMercurialRevisionFinder::test_default_revision TEST-UNEXPECTED-FAIL

Categories

(Firefox Build System :: General, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: intermittent-bug-filer, Assigned: dhouse)

References

Details

(Keywords: in-triage, intermittent-failure)

[task 2020-06-08T20:44:41.214Z]  1:59.24 python/mozbuild/mozpack/test/test_files.py::TestMercurialRevisionFinder::test_default_revision TEST-UNEXPECTED-FAIL
[task 2020-06-08T20:44:41.214Z]  1:59.24 python/mozbuild/mozpack/test/test_files.py::TestMercurialRevisionFinder::test_old_revision TEST-UNEXPECTED-FAIL
[task 2020-06-08T20:44:41.214Z]  1:59.24 python/mozbuild/mozpack/test/test_files.py::TestMercurialRevisionFinder::test_recognize_repo_paths TEST-UNEXPECTED-FAIL
[task 2020-06-08T20:44:41.214Z]  1:59.24 =================================== FAILURES ===================================
[task 2020-06-08T20:44:41.214Z]  1:59.24 ______________ TestMercurialRevisionFinder.test_default_revision _______________
[task 2020-06-08T20:44:41.214Z]  1:59.24 
[task 2020-06-08T20:44:41.214Z]  1:59.24 self = <mozpack.test.test_files.TestMercurialRevisionFinder testMethod=test_default_revision>
[task 2020-06-08T20:44:41.214Z]  1:59.24 
[task 2020-06-08T20:44:41.214Z]  1:59.24     def setUp(self):
[task 2020-06-08T20:44:41.214Z]  1:59.24         super(TestMercurialRevisionFinder, self).setUp()
[task 2020-06-08T20:44:41.215Z]  1:59.24 >       hglib.init(self.tmpdir)
[task 2020-06-08T20:44:41.215Z]  1:59.24 
[task 2020-06-08T20:44:41.215Z]  1:59.24 python/mozbuild/mozpack/test/test_files.py:1185:
[task 2020-06-08T20:44:41.215Z]  1:59.24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2020-06-08T20:44:41.215Z]  1:59.24 
[task 2020-06-08T20:44:41.215Z]  1:59.24 dest = '/var/folders/64/xn2tpyws5bx2bnc0c1hk26z4000017/T/tmp5iUbjv', ssh = None
[task 2020-06-08T20:44:41.215Z]  1:59.24 remotecmd = None, insecure = False, encoding = None, configs = None
[task 2020-06-08T20:44:41.215Z]  1:59.24 
[task 2020-06-08T20:44:41.215Z]  1:59.24     def init(dest=None, ssh=None, remotecmd=None, insecure=False,
[task 2020-06-08T20:44:41.215Z]  1:59.24              encoding=None, configs=None):
[task 2020-06-08T20:44:41.215Z]  1:59.24         args = util.cmdbuilder('init', dest, e=ssh, remotecmd=remotecmd,
[task 2020-06-08T20:44:41.215Z]  1:59.24                                insecure=insecure)
[task 2020-06-08T20:44:41.215Z]  1:59.24 
[task 2020-06-08T20:44:41.215Z]  1:59.24         args.insert(0, HGPATH)
[task 2020-06-08T20:44:41.215Z]  1:59.24         proc = util.popen(args)
[task 2020-06-08T20:44:41.216Z]  1:59.24         out, err = proc.communicate()
[task 2020-06-08T20:44:41.220Z]  1:59.25         if proc.returncode:
[task 2020-06-08T20:44:41.220Z]  1:59.25 >           raise error.CommandError(args, proc.returncode, out, err)
[task 2020-06-08T20:44:41.220Z]  1:59.25 E           CommandError: (1, '', 'Traceback (most recent call last):\n  File "/usr/local/bin/hg", line 30, in <module>\n    from hgdemandimport import tracing\n  File "/Users/cltbld/tasks/task_1591645778/checkouts/gecko/build/mach_bootstrap.py", line 475, in __call__\n    module = self._original_import(name, globals, locals, fromlist, level)\nImportError: No module named hgdemandimport')
[task 2020-06-08T20:44:41.220Z]  1:59.25 
[task 2020-06-08T20:44:41.220Z]  1:59.25 third_party/python/python-hglib/hglib/__init__.py:22: CommandError
[task 2020-06-08T20:44:41.220Z]  1:59.25 ________________ TestMercurialRevisionFinder.test_old_revision _________________
[task 2020-06-08T20:44:41.220Z]  1:59.25 
[task 2020-06-08T20:44:41.220Z]  1:59.25 self = <mozpack.test.test_files.TestMercurialRevisionFinder testMethod=test_old_revision>
[task 2020-06-08T20:44:41.220Z]  1:59.25 
[task 2020-06-08T20:44:41.221Z]  1:59.25     def setUp(self):
[task 2020-06-08T20:44:41.221Z]  1:59.25         super(TestMercurialRevisionFinder, self).setUp()
[task 2020-06-08T20:44:41.221Z]  1:59.25 >       hglib.init(self.tmpdir)
[task 2020-06-08T20:44:41.221Z]  1:59.25 
[task 2020-06-08T20:44:41.221Z]  1:59.25 python/mozbuild/mozpack/test/test_files.py:1185:
[task 2020-06-08T20:44:41.221Z]  1:59.25 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2020-06-08T20:44:41.221Z]  1:59.25 
[task 2020-06-08T20:44:41.221Z]  1:59.25 dest = '/var/folders/64/xn2tpyws5bx2bnc0c1hk26z4000017/T/tmpUsDO0P', ssh = None
[task 2020-06-08T20:44:41.221Z]  1:59.25 remotecmd = None, insecure = False, encoding = None, configs = None
[task 2020-06-08T20:44:41.221Z]  1:59.25 
[task 2020-06-08T20:44:41.221Z]  1:59.25     def init(dest=None, ssh=None, remotecmd=None, insecure=False,
[task 2020-06-08T20:44:41.221Z]  1:59.25              encoding=None, configs=None):
[task 2020-06-08T20:44:41.222Z]  1:59.25         args = util.cmdbuilder('init', dest, e=ssh, remotecmd=remotecmd,
[task 2020-06-08T20:44:41.222Z]  1:59.25                                insecure=insecure)
[task 2020-06-08T20:44:41.222Z]  1:59.25 
[task 2020-06-08T20:44:41.222Z]  1:59.25         args.insert(0, HGPATH)
[task 2020-06-08T20:44:41.222Z]  1:59.25         proc = util.popen(args)
[task 2020-06-08T20:44:41.222Z]  1:59.25         out, err = proc.communicate()
[task 2020-06-08T20:44:41.222Z]  1:59.25         if proc.returncode:
[task 2020-06-08T20:44:41.222Z]  1:59.25 >           raise error.CommandError(args, proc.returncode, out, err)
[task 2020-06-08T20:44:41.222Z]  1:59.25 E           CommandError: (1, '', 'Traceback (most recent call last):\n  File "/usr/local/bin/hg", line 30, in <module>\n    from hgdemandimport import tracing\n  File "/Users/cltbld/tasks/task_1591645778/checkouts/gecko/build/mach_bootstrap.py", line 475, in __call__\n    module = self._original_import(name, globals, locals, fromlist, level)\nImportError: No module named hgdemandimport')
[task 2020-06-08T20:44:41.222Z]  1:59.25 
[task 2020-06-08T20:44:41.222Z]  1:59.25 third_party/python/python-hglib/hglib/__init__.py:22: CommandError
[task 2020-06-08T20:44:41.222Z]  1:59.25 ____________ TestMercurialRevisionFinder.test_recognize_repo_paths _____________
[task 2020-06-08T20:44:41.222Z]  1:59.25 
[task 2020-06-08T20:44:41.223Z]  1:59.25 self = <mozpack.test.test_files.TestMercurialRevisionFinder testMethod=test_recognize_repo_paths>
[task 2020-06-08T20:44:41.223Z]  1:59.25 
[task 2020-06-08T20:44:41.223Z]  1:59.25     def setUp(self):
[task 2020-06-08T20:44:41.223Z]  1:59.25         super(TestMercurialRevisionFinder, self).setUp()
[task 2020-06-08T20:44:41.223Z]  1:59.25 >       hglib.init(self.tmpdir)
[task 2020-06-08T20:44:41.223Z]  1:59.25 
[task 2020-06-08T20:44:41.223Z]  1:59.25 python/mozbuild/mozpack/test/test_files.py:1185:
[task 2020-06-08T20:44:41.223Z]  1:59.25 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2020-06-08T20:44:41.223Z]  1:59.25 
[task 2020-06-08T20:44:41.223Z]  1:59.25 dest = '/var/folders/64/xn2tpyws5bx2bnc0c1hk26z4000017/T/tmpwOM2V2', ssh = None
[task 2020-06-08T20:44:41.223Z]  1:59.25 remotecmd = None, insecure = False, encoding = None, configs = None
[task 2020-06-08T20:44:41.223Z]  1:59.25 
[task 2020-06-08T20:44:41.223Z]  1:59.25     def init(dest=None, ssh=None, remotecmd=None, insecure=False,
[task 2020-06-08T20:44:41.224Z]  1:59.25              encoding=None, configs=None):
[task 2020-06-08T20:44:41.224Z]  1:59.25         args = util.cmdbuilder('init', dest, e=ssh, remotecmd=remotecmd,
[task 2020-06-08T20:44:41.224Z]  1:59.25                                insecure=insecure)
[task 2020-06-08T20:44:41.224Z]  1:59.25 
[task 2020-06-08T20:44:41.224Z]  1:59.25         args.insert(0, HGPATH)
[task 2020-06-08T20:44:41.224Z]  1:59.25         proc = util.popen(args)
[task 2020-06-08T20:44:41.224Z]  1:59.25         out, err = proc.communicate()
[task 2020-06-08T20:44:41.224Z]  1:59.25         if proc.returncode:
[task 2020-06-08T20:44:41.224Z]  1:59.25 >           raise error.CommandError(args, proc.returncode, out, err)
[task 2020-06-08T20:44:41.224Z]  1:59.25 E           CommandError: (1, '', 'Traceback (most recent call last):\n  File "/usr/local/bin/hg", line 30, in <module>\n    from hgdemandimport import tracing\n  File "/Users/cltbld/tasks/task_1591645778/checkouts/gecko/build/mach_bootstrap.py", line 475, in __call__\n    module = self._original_import(name, globals, locals, fromlist, level)\nImportError: No module named hgdemandimport')
[task 2020-06-08T20:44:41.224Z]  1:59.25 
[task 2020-06-08T20:44:41.225Z]  1:59.25 third_party/python/python-hglib/hglib/__init__.py:22: CommandError
Summary: Intermittent python/mozbuild/mozpack/test/test_files.py::TestMercurialRevisionFinder::test_default_revision TEST-UNEXPECTED-FAIL → Perma [tier2] python/mozbuild/mozpack/test/test_files.py::TestMercurialRevisionFinder::test_default_revision TEST-UNEXPECTED-FAIL
Keywords: in-triage
Assignee: nobody → rstewart
See Also: → 1644320

Bug 1644320 also started popping up on June 8 and also retries of old, succeeding builds are failing today. I find it very difficult to believe they weren't caused by the same infra change.

It looks like the failure is:

ImportError: No module named hgdemandimport

Am I reading the log correctly?

Yes. Note that that's not an import in mozilla-central code, but it's just part of the contents of /usr/local/bin/hg. So the hg installation on the Mac machines is currently messed up, it's importing a package that is no longer installed on the machines.

(In reply to Ricky Stewart from comment #8)

Yes. Note that that's not an import in mozilla-central code, but it's just part of the contents of /usr/local/bin/hg. So the hg installation on the Mac machines is currently messed up, it's importing a package that is no longer installed on the machines.

Thankyou! That helps tremendously. I though this was in the virtualenv of a task. I'll check the hg install, and test with a reinstall.

Depends on: 1645229

(In reply to Ricky Stewart from comment #8)

Yes. Note that that's not an import in mozilla-central code, but it's just part of the contents of /usr/local/bin/hg. So the hg installation on the Mac machines is currently messed up, it's importing a package that is no longer installed on the machines.

:rstewart it appears this test is doing something different than other tasks as afaict this is the only task encountering this problem. Do you know if this test could be changed to fix it or who might know more about this test?

Flags: needinfo?(rstewart)

It's not doing "something different" than other tasks, it's doing the same thing as other tasks, namely, importing hglib and doing stuff with it in order to test code in python/mozbuild/mozpack/files.py. The issue is as described above, namely, /usr/local/bin/hg is broken. We could delete the test but I'd really not like to do that just because the automation machines are broken.

Flags: needinfo?(rstewart)

(That's my understanding of the issue, anyway. If we're really of the opinion that the automation machines are working fine, and the fault is really in m-c code, I would need a lot more information from you to elucidate why that is. As you mentioned, all the other tasks are working fine, including tasks on different OS's that test this same code, so that really does suggest a configuration problem to me.)

(In reply to Ricky Stewart from comment #14)

(That's my understanding of the issue, anyway. If we're really of the opinion that the automation machines are working fine, and the fault is really in m-c code, I would need a lot more information from you to elucidate why that is. As you mentioned, all the other tasks are working fine, including tasks on different OS's that test this same code, so that really does suggest a configuration problem to me.)

I think the problem is with the automation machine setup. The macos package for mercurial that we're using results in a dependence on the environment paths to include the mercurial python modules. Perhaps this is unique to our setup, or most people do not encounter it because of homebrew or python environments.

I asked about the task because it seems to be the only one with this problem. But I base that on not receiving reports of problems and task failure counts being the same as normal.

I will work on fixing the hg setup so that the paths (and finding of libdir) are correct.

It is fixed now on the macos automation machines. I worked around the path issue with a symlink of /Library as /usr/Library for hg to find without us changing the installer or hg script.

I ran one test against the production pool after making the symlink and confirmed it passes: https://firefox-ci-tc.services.mozilla.com/tasks/ZraUbHD4Q_2KuCSz1oB0KQ
I'll get the fix merged into our puppet configuration so we don't lose the change.

I applied the fix on the workers on the 17th, and it looks like the failure has not repeated.

Yeah, I don't see it happening any more either. Thanks!!

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Assignee: rstewart → dhouse
You need to log in before you can comment on or make changes to this bug.