Closed Bug 1652503 Opened 4 years ago Closed 4 years ago

Perma 0:29.34 tools/lint/test/test_black.py::test_lint_black[black] TEST-UNEXPECTED-FAIL

Categories

(Developer Infrastructure :: Lint and Formatting, defect, P5)

defect

Tracking

(firefox-esr68 unaffected, firefox-esr78 unaffected, firefox78 unaffected, firefox79 unaffected, firefox80 fixed)

RESOLVED FIXED
mozilla80
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox78 --- unaffected
firefox79 --- unaffected
firefox80 --- fixed

People

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

References

(Regression)

Details

(Keywords: intermittent-failure, regression)

Attachments

(7 files)

Filed by: csabou [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer.html#?job_id=309594269&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/fLuB_OXnTCGaMFZEzwsZsA/runs/0/artifacts/public/logs/live_backing.log


[task 2020-07-13T15:48:20.928Z] 0:28.72 tools/lint/test/test_clippy.py::test_cleanup[clippy] PASSED
[task 2020-07-13T15:48:20.928Z] 0:28.72
[task 2020-07-13T15:48:20.928Z] 0:28.72 =========================== 5 passed in 3.40 seconds ===========================
[task 2020-07-13T15:48:21.537Z] 0:29.33 /builds/worker/checkouts/gecko/tools/lint/test/test_black.py
[task 2020-07-13T15:48:21.544Z] 0:29.33 ============================= test session starts ==============================
[task 2020-07-13T15:48:21.544Z] 0:29.34 platform linux -- Python 3.6.9, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- /builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/gecko-QUm8IANb-3/bin/python
[task 2020-07-13T15:48:21.544Z] 0:29.34 rootdir: /builds/worker/checkouts/gecko, inifile: /builds/worker/checkouts/gecko/config/mozunit/mozunit/pytest.ini
[task 2020-07-13T15:48:21.544Z] 0:29.34 collecting ... collected 1 item
[task 2020-07-13T15:48:21.544Z] 0:29.34
[task 2020-07-13T15:48:21.544Z] 0:29.34 tools/lint/test/test_black.py::test_lint_black[black] TEST-UNEXPECTED-FAIL
[task 2020-07-13T15:48:21.544Z] 0:29.34
[task 2020-07-13T15:48:21.546Z] 0:29.34 =================================== FAILURES ===================================
[task 2020-07-13T15:48:21.546Z] 0:29.34 ____________________________ test_lint_black[black] ____________________________
[task 2020-07-13T15:48:21.547Z] 0:29.34
[task 2020-07-13T15:48:21.547Z] 0:29.34 lint = <function lint.<locals>.wrapper at 0x7fb68143ef28>
[task 2020-07-13T15:48:21.548Z] 0:29.34 paths = <function paths.<locals>._inner at 0x7fb680e34620>
[task 2020-07-13T15:48:21.549Z] 0:29.34
[task 2020-07-13T15:48:21.550Z] 0:29.34 def test_lint_black(lint, paths):
[task 2020-07-13T15:48:21.551Z] 0:29.34 results = lint(paths())
[task 2020-07-13T15:48:21.553Z] 0:29.34 assert len(results) == 2
[task 2020-07-13T15:48:21.554Z] 0:29.34
[task 2020-07-13T15:48:21.555Z] 0:29.34 > assert "EOF" in results[0].message
[task 2020-07-13T15:48:21.556Z] 0:29.34 E assert 'EOF' in 'Reformat python'
[task 2020-07-13T15:48:21.557Z] 0:29.34 E + where 'Reformat python' = Issue({\n "linter": "black",\n "path": "/builds/worker/checkouts/gecko/tools/lint/test/files/black/bad.py",\n "message...l,\n "source": null,\n "level": "error",\n "rule": null,\n "lineoffset": null,\n "diff": null,\n "relpath": "bad.py"\n}).message
[task 2020-07-13T15:48:21.559Z] 0:29.35
[task 2020-07-13T15:48:21.560Z] 0:29.35 tools/lint/test/test_black.py:16: AssertionError
[task 2020-07-13T15:48:21.561Z] 0:29.35 ----------------------------- Captured stderr call -----------------------------
[task 2020-07-13T15:48:21.561Z] 0:29.35 15:48:21.80 black (645) | Black version 19.10b0
[task 2020-07-13T15:48:21.561Z] 0:29.35 15:48:21.80 black (645) | Command: /builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/gecko-QUm8IANb-3/bin/black --check /builds/worker/checkouts/gecko/tools/lint/test/files/black/bad.py /builds/worker/checkouts/gecko/tools/lint/test/files/black/invalid.py
[task 2020-07-13T15:48:21.561Z] 0:29.35 ------------------------------ Captured log call -------------------------------
[task 2020-07-13T15:48:21.561Z] 0:29.35 black.py 116 DEBUG Black version 19.10b0
[task 2020-07-13T15:48:21.561Z] 0:29.35 black.py 122 DEBUG Command: /builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/gecko-QUm8IANb-3/bin/black --check /builds/worker/checkouts/gecko/tools/lint/test/files/black/bad.py /builds/worker/checkouts/gecko/tools/lint/test/files/black/invalid.py
[task 2020-07-13T15:48:21.561Z] 0:29.35 =========================== 1 failed in 2.50 seconds ===========================
[task 2020-07-13T15:48:21.561Z] 0:29.35 Setting retcode to 1 from /builds/worker/checkouts/gecko/tools/lint/test/test_black.py
[task 2020-07-13T15:48:21.860Z] 0:29.65 /builds/worker/checkouts/gecko/tools/lint/test/test_file_whitespace.py
[task 2020-07-13T15:48:21.860Z] 0:29.65 ============================= test session starts ==============================
[task 2020-07-13T15:48:21.861Z] 0:29.65 platform linux -- Python 3.6.9, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- /builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/gecko-QUm8IANb-3/bin/python
[task 2020-07-13T15:48:21.861Z] 0:29.65 rootdir: /builds/worker/checkouts/gecko, inifile: /builds/worker/checkouts/gecko/config/mozunit/mozunit/pytest.ini
[task 2020-07-13T15:48:21.862Z] 0:29.65 collecting ... collected 1 item

Set release status flags based on info from the regressing bug 1651867

Sylvestre, there is a new occurrence. Can you please take a look?
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=310382865&repo=autoland&lineNumber=963

Flags: needinfo?(sledru)
Summary: Intermittent 0:29.34 tools/lint/test/test_black.py::test_lint_black[black] TEST-UNEXPECTED-FAIL → Perma 0:29.34 tools/lint/test/test_black.py::test_lint_black[black] TEST-UNEXPECTED-FAIL

Tom is the one who landed it :)

Flags: needinfo?(sledru) → needinfo?(mozilla)

The root yamlint config would accepts the invalid test file,
so force the test to use the default yamllint config.

Assignee: nobody → mozilla
Status: NEW → ASSIGNED

This gives sorting on Issue for free, which makes it easier to write tests
for linters.

Attachment #9165594 - Attachment description: Bug 1652503: [mozlint] Make yamllint test indenpendent of the environment; r?lint-reviewers → Bug 1652503: [mozlint] Make yamllint test indenpendent of the environment;
Attachment #9165595 - Attachment description: Bug 1652503: [mozlint] Always use vendored yamllint; r?lint-reviewers → Bug 1652503: [mozlint] Always use vendored yamllint;
Attachment #9165596 - Attachment description: Bug 1652503: [mozlint] Use `attrs` for `mozlint.result.Issue`; r?lint-reviewers → Bug 1652503: [mozlint] Use `attrs` for `mozlint.result.Issue`;
Attachment #9165597 - Attachment description: Bug 1652503: [mozlint] Sort the results of lints in the lint tests; r?lint-reviewers → Bug 1652503: [mozlint] Sort the results of lints in the lint tests;
Attachment #9165598 - Attachment description: Bug 1652503: [mozlint] Use `mozpack.path` for paths in lint tests; r?lint-reviewers → Bug 1652503: [mozlint] Use `mozpack.path` for paths in lint tests;
Attachment #9165599 - Attachment description: Bug 1652503: [mozlint] Install rstcheck for tests; r?lint-reviewers → Bug 1652503: [mozlint] Install rstcheck for tests;
Pushed by mozilla@hocat.ca:
https://hg.mozilla.org/integration/autoland/rev/b4ea018b2b83
[mozlint] Make yamllint test indenpendent of the environment; r=linter-reviewers,ahal
https://hg.mozilla.org/integration/autoland/rev/8e015d90d36b
[mozlint] Always use vendored yamllint; r=ahal
https://hg.mozilla.org/integration/autoland/rev/fd62c070359b
[mozlint] Use `attrs` for `mozlint.result.Issue`; r=ahal
https://hg.mozilla.org/integration/autoland/rev/1e61f55a5cd7
[mozlint] Sort the results of lints in the lint tests; r=ahal
https://hg.mozilla.org/integration/autoland/rev/2bf32877d9fc
[mozlint] Use `mozpack.path` for paths in lint tests; r=ahal
https://hg.mozilla.org/integration/autoland/rev/625930106602
[mozlint] Install rstcheck for tests; r=ahal

This apparently broke lint commit hooks on Windows, in particular https://hg.mozilla.org/integration/autoland/rev/fd62c070359b requires python 3 but mozilla build (at least in my case) seems to still default to python 2.7. I see this:

$ hg amend
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "d:\mozilla-build\python3\lib\multiprocessing\spawn.py", line 105, in spawn_main
    exitcode = _main(fd)
  File "d:\mozilla-build\python3\lib\multiprocessing\spawn.py", line 115, in _main
    self = reduction.pickle.load(from_parent)
  File "d:\src\python/mozlint\mozlint\__init__.py", line 6, in <module>
    from .roller import LintRoller
  File "d:\src\python/mozlint\mozlint\roller.py", line 25, in <module>
    from .parser import Parser
  File "d:\src\python/mozlint\mozlint\parser.py", line 12, in <module>
    from .types import supported_types
  File "d:\src\python/mozlint\mozlint\types.py", line 14, in <module>
    from . import result
  File "d:\src\python/mozlint\mozlint\result.py", line 60, in <module>
    @attr.s(slots=True, kw_only=True)
TypeError: attrs() got an unexpected keyword argument 'kw_only'

That traceback looks like it is using python3, but a version of attrs that is different than the one vendored in-tree. I'm not entirely sure how that is possible, but is definitely a different bug that was exposed via this change. I'm curious which hooks you are using, and whether they are up-to-date with the versions in-tree.

Flags: needinfo?(mozilla)
Regressions: 1655220

(In reply to Tom Prince [:tomprince] from comment #15)

That traceback looks like it is using python3, but a version of attrs that is different than the one vendored in-tree. I'm not entirely sure how that is possible, but is definitely a different bug that was exposed via this change. I'm curious which hooks you are using, and whether they are up-to-date with the versions in-tree.

It actually also happens without the commit hooks, just by running hg amend

yeah, I get this also

I was doing a rebase and it failed to commit the fixes.

getting past the kw_args issue by deleting the named arg, I then get:

ValueError: No mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: Attribute(name='message', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False)

  File "c:\Users\elvis\mozilla-central\tools/lint/mach_commands.py", line 133, in eslint
    **kwargs
  File "c:\Users\elvis\mozilla-central\python/mach\mach\registrar.py", line 135, in dispatch
    if handler.parser:
  File "c:\Users\elvis\mozilla-central\python/mach\mach\decorators.py", line 87, in parser
    self._parser = self._parser()
  File "c:\Users\elvis\mozilla-central\tools/lint/mach_commands.py", line 40, in setup_argument_parser
    from mozlint import cli
  File "c:\Users\elvis\mozilla-central\build/mach_bootstrap.py", line 472, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "c:\Users\elvis\mozilla-central\python/mozlint\mozlint\__init__.py", line 6, in <module>
    from .roller import LintRoller
  File "c:\Users\elvis\mozilla-central\build/mach_bootstrap.py", line 472, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "c:\Users\elvis\mozilla-central\python/mozlint\mozlint\roller.py", line 25, in <module>
    from .parser import Parser
  File "c:\Users\elvis\mozilla-central\build/mach_bootstrap.py", line 472, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "c:\Users\elvis\mozilla-central\python/mozlint\mozlint\parser.py", line 12, in <module>
    from .types import supported_types
  File "c:\Users\elvis\mozilla-central\build/mach_bootstrap.py", line 472, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "c:\Users\elvis\mozilla-central\python/mozlint\mozlint\types.py", line 14, in <module>
    from . import result
  File "c:\Users\elvis\mozilla-central\build/mach_bootstrap.py", line 472, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "c:\Users\elvis\mozilla-central\python/mozlint\mozlint\result.py", line 62, in <module>
    class Issue(object):
  File "c:\Users\elvis\mozilla-central\third_party/python/attrs/src\attr\_make.py", line 906, in wrap
    is_exc,
  File "c:\Users\elvis\mozilla-central\third_party/python/attrs/src\attr\_make.py", line 472, in __init__
    cls, these, auto_attribs, kw_only
  File "c:\Users\elvis\mozilla-central\third_party/python/attrs/src\attr\_make.py", line 400, in _transform_attrs
    "default value or factory.  Attribute in question: %r" % (a,)
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-Break to quit

:tomprince, do you have tips for how to get my tree useful again? even if this is backed out in-tree, I am stuck.

Flags: needinfo?(mozilla)

ok, removing the entire @attr.s line allows me to continue, hopefully we can fix this asap or get this all backed out until it can be fixed.

You can backout fd62c070359b locally and rebase your patches on top of that, it WFM that way, it's a bit annoying but better than being stuck.

These packages are all vendored in-tree, so no need to install them again.
This also fixes the issue that these packages are older than the vendored
versions, which causes issues with the use of attrs in mozlint now.

Pushed by mozilla@hocat.ca:
https://hg.mozilla.org/integration/autoland/rev/85753c06d024
[lint] Remove old requirements for perfdocs; r=ahal
Flags: needinfo?(mozilla)
Has Regression Range: --- → yes
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: