Closed Bug 1478050 Opened Last year Closed 19 days ago

Intermittent Mochitest harness failure OSError: [Errno 17] File exists in linux64 testing/mochitest/tests/python/test_build_profile.py::test_common_prefs_are_all_set

Categories

(Testing :: Mozbase, defect, P5)

Version 3
defect

Tracking

(firefox63 fixed)

RESOLVED DUPLICATE of bug 1503063
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: nataliaCs, Assigned: ahal)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=189823719&repo=autoland&lineNumber=74134

Push: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=61f33f8c87508dae19c577c74ec71eae459c6aaf&selectedJob=189820943

Task details: https://tools.taskcluster.net/groups/dE3iZ2vVRTiqI_xdjGp8aA/tasks/QZeZaim7TgaZcX_5R0vO7w/details

[task 2018-07-24T15:21:52.044Z]  0:24.52 ==================================== ERRORS ====================================
[task 2018-07-24T15:21:52.044Z]  0:24.52 _______________ ERROR at setup of test_common_prefs_are_all_set ________________
[task 2018-07-24T15:21:52.045Z]  0:24.52 
[task 2018-07-24T15:21:52.045Z]  0:24.52 request = <SubRequest 'skip_using_mozinfo' for <Function 'test_common_prefs_are_all_set'>>
[task 2018-07-24T15:21:52.045Z]  0:24.53 setup_test_harness = <function inner at 0x7f3ffc002230>
[task 2018-07-24T15:21:52.046Z]  0:24.53 
[task 2018-07-24T15:21:52.046Z]  0:24.53     @pytest.fixture(autouse=True)  # noqa: F811
[task 2018-07-24T15:21:52.047Z]  0:24.53     def skip_using_mozinfo(request, setup_test_harness):
[task 2018-07-24T15:21:52.048Z]  0:24.53         """Gives tests the ability to skip based on values from mozinfo.
[task 2018-07-24T15:21:52.048Z]  0:24.53 
[task 2018-07-24T15:21:52.048Z]  0:24.53         Example:
[task 2018-07-24T15:21:52.048Z]  0:24.53             @pytest.mark.skip_mozinfo("!e10s || os == 'linux'")
[task 2018-07-24T15:21:52.048Z]  0:24.53             def test_foo():
[task 2018-07-24T15:21:52.048Z]  0:24.53                 pass
[task 2018-07-24T15:21:52.049Z]  0:24.53         """
[task 2018-07-24T15:21:52.049Z]  0:24.53 
[task 2018-07-24T15:21:52.049Z]  0:24.53 >       setup_test_harness(*setup_args)
[task 2018-07-24T15:21:52.049Z]  0:24.53 
[task 2018-07-24T15:21:52.049Z]  0:24.53 testing/mochitest/tests/python/conftest.py:102:
[task 2018-07-24T15:21:52.049Z]  0:24.53 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2018-07-24T15:21:52.049Z]  0:24.53 
[task 2018-07-24T15:21:52.049Z]  0:24.53 files_dir = '/builds/worker/checkouts/gecko/testing/mochitest/tests/python/files'
[task 2018-07-24T15:21:52.049Z]  0:24.53 args = ('mochitest', 'testing/mochitest'), kwargs = {}
[task 2018-07-24T15:21:52.049Z]  0:24.53 harness_root = '/builds/worker/fetches/tests/mochitest'
[task 2018-07-24T15:21:52.050Z]  0:24.53 test_root = '/builds/worker/fetches/tests/mochitest/tests/selftests'
[task 2018-07-24T15:21:52.050Z]  0:24.53 
[task 2018-07-24T15:21:52.050Z]  0:24.53     def inner(files_dir, *args, **kwargs):
[task 2018-07-24T15:21:52.050Z]  0:24.53         harness_root = _get_test_harness(*args, **kwargs)
[task 2018-07-24T15:21:52.050Z]  0:24.53         if harness_root:
[task 2018-07-24T15:21:52.050Z]  0:24.53             sys.path.insert(0, harness_root)
[task 2018-07-24T15:21:52.050Z]  0:24.53 
[task 2018-07-24T15:21:52.050Z]  0:24.53             # Link the test files to the test package so updates are automatically
[task 2018-07-24T15:21:52.051Z]  0:24.53             # picked up. Fallback to copy on Windows.
[task 2018-07-24T15:21:52.051Z]  0:24.53             if files_dir:
[task 2018-07-24T15:21:52.051Z]  0:24.53                 test_root = os.path.join(harness_root, 'tests', 'selftests')
[task 2018-07-24T15:21:52.051Z]  0:24.53                 if not os.path.exists(test_root):
[task 2018-07-24T15:21:52.051Z]  0:24.53                     if hasattr(os, 'symlink'):
[task 2018-07-24T15:21:52.051Z]  0:24.53 >                       os.symlink(files_dir, test_root)
[task 2018-07-24T15:21:52.051Z]  0:24.53 E                       OSError: [Errno 17] File exists
[task 2018-07-24T15:21:52.051Z]  0:24.53 
[task 2018-07-24T15:21:52.051Z]  0:24.53 testing/mozbase/moztest/moztest/selftest/fixtures.py:63: OSError
[task 2018-07-24T15:21:52.051Z]  0:24.53 =========================== 1 error in 0.10 seconds ============================
Flags: needinfo?(ahal)
Looks like this first started showing up with bug 1468812 which makes some sense I guess. I think this situation can only happen if there is a broken symbolic link, so in that case let's just remove it to be safe.
Assignee: nobody → ahal
Blocks: 1468812
Status: NEW → ASSIGNED
Flags: needinfo?(ahal)
It's unclear how this situation can actually happen, but it has caused a couple of
intermittents.
Comment on attachment 8994825 [details]
Bug 1478050 - [moztest] Clean up broken symlinks when setting up test_harness_root

Geoff Brown [:gbrown] has approved the revision.

https://phabricator.services.mozilla.com/D2355
Attachment #8994825 - Flags: review+
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dc2c0589597a
[moztest] Clean up broken symlinks when setting up test_harness_root r=gbrown
https://hg.mozilla.org/mozilla-central/rev/dc2c0589597a
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Still occurring on https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=d99af6383af161ac0f0d32bc34e2027d763dc93c&selectedJob=191257598 

Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=191257598&repo=autoland&lineNumber=74197

[task 2018-07-31T22:30:23.196Z]  0:25.87 
[task 2018-07-31T22:30:23.196Z]  0:25.87 testing/mochitest/tests/python/conftest.py:102:
[task 2018-07-31T22:30:23.196Z]  0:25.87 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2018-07-31T22:30:23.196Z]  0:25.87 
[task 2018-07-31T22:30:23.197Z]  0:25.87 files_dir = '/builds/worker/checkouts/gecko/testing/mochitest/tests/python/files'
[task 2018-07-31T22:30:23.197Z]  0:25.87 args = ('mochitest', 'testing/mochitest'), kwargs = {}
[task 2018-07-31T22:30:23.197Z]  0:25.87 harness_root = '/builds/worker/fetches/tests/mochitest'
[task 2018-07-31T22:30:23.197Z]  0:25.87 test_root = '/builds/worker/fetches/tests/mochitest/tests/selftests'
[task 2018-07-31T22:30:23.197Z]  0:25.87 
[task 2018-07-31T22:30:23.197Z]  0:25.87     def inner(files_dir, *args, **kwargs):
[task 2018-07-31T22:30:23.198Z]  0:25.87         harness_root = _get_test_harness(*args, **kwargs)
[task 2018-07-31T22:30:23.198Z]  0:25.87         if harness_root:
[task 2018-07-31T22:30:23.198Z]  0:25.87             sys.path.insert(0, harness_root)
[task 2018-07-31T22:30:23.198Z]  0:25.87 
[task 2018-07-31T22:30:23.198Z]  0:25.87             # Link the test files to the test package so updates are automatically
[task 2018-07-31T22:30:23.198Z]  0:25.87             # picked up. Fallback to copy on Windows.
[task 2018-07-31T22:30:23.199Z]  0:25.87             if files_dir:
[task 2018-07-31T22:30:23.199Z]  0:25.87                 test_root = os.path.join(harness_root, 'tests', 'selftests')
[task 2018-07-31T22:30:23.199Z]  0:25.87                 if not os.path.exists(test_root):
[task 2018-07-31T22:30:23.199Z]  0:25.87                     if os.path.lexists(test_root):
[task 2018-07-31T22:30:23.199Z]  0:25.87                         os.remove(test_root)
[task 2018-07-31T22:30:23.200Z]  0:25.87 
[task 2018-07-31T22:30:23.200Z]  0:25.87                     if hasattr(os, 'symlink'):
[task 2018-07-31T22:30:23.200Z]  0:25.87 >                       os.symlink(files_dir, test_root)
[task 2018-07-31T22:30:23.200Z]  0:25.87 E                       OSError: [Errno 17] File exists
[task 2018-07-31T22:30:23.200Z]  0:25.87 
[task 2018-07-31T22:30:23.201Z]  0:25.87 testing/mozbase/moztest/moztest/selftest/fixtures.py:66: OSError
[task 2018-07-31T22:30:23.201Z]  0:25.87 =========================== 1 error in 0.10 seconds ============================
Flags: needinfo?(ahal)
I have no idea how this could still be happening :/. Unless the "test_root" dir is somehow being created between the os.path.exists() check and os.symlink()..
Status: RESOLVED → REOPENED
Flags: needinfo?(ahal)
Resolution: FIXED → ---
Summary: Mochitest harness failure OSError: [Errno 17] File exists → Intermittent Mochitest harness failure OSError: [Errno 17] File exists in linux64 testing/mochitest/tests/python/test_build_profile.py::test_common_prefs_are_all_set
Priority: -- → P5
Duplicate of this bug: 1477149
Status: REOPENED → RESOLVED
Closed: Last year19 days ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1503063
You need to log in before you can comment on or make changes to this bug.