Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistent result in multiple runs #2573

Closed
ihji opened this issue Oct 26, 2018 · 4 comments
Closed

inconsistent result in multiple runs #2573

ihji opened this issue Oct 26, 2018 · 4 comments
Labels
Bug 🪲 Duplicate 🐫 Duplicate of an already existing issue multiprocessing

Comments

@ihji
Copy link

ihji commented Oct 26, 2018

I'm looking into the strange result from pylint on Apache Beam Python SDK. Multiple runs return slightly different results. It looks something related to multi-processing thing because I couldn't find any pattern from this behavior.

Steps to reproduce

  1. Clone https://github.com/apache/beam and checkout 0c8ccae9aa608f4d64b22c08d57b9aaa8724bfee
  2. Go into sdks/python directory.
  3. Run scripts/run_pylint.sh multiple times and compare the result.

Current behavior

beam/sdks/python$ for i in `seq 100`; do scripts/run_pylint.sh; done > lint_100.txt
beam/sdks/python$ grep slots-on-old-class lint_100.txt | wc -l
100
beam/sdks/python$ grep no-self-argument lint_100.txt | wc -l
42

Expected behavior

Consistently return the same result

pylint --version output

Using config file beam/sdks/python/.pylintrc
pylint 1.9.3, 
astroid 1.6.5
Python 2.7.13 (default, Nov 24 2017, 17:33:09) 
[GCC 6.3.0 20170516]

Related issue: https://issues.apache.org/jira/browse/BEAM-5846

@PCManticore
Copy link
Contributor

Thanks for the report! multiprocessing might definitely affect this.

@PCManticore PCManticore added Bug 🪲 Needs reproduction 🔍 Need a way to reproduce it locally on a maintainer's machine labels Nov 23, 2018
@jazelenk
Copy link

I observe this behavior as well. Most commonly, running with multiple jobs enabled gives false negatives- constraining to -j 1 shows more errors.

Here's an easy example:

(venv) $ cat a.py
# pylint: disable=invalid-name,missing-module-docstring,unused-import
import b
(venv) $ cat b.py
# pylint: disable=invalid-name,missing-module-docstring,unused-import
import a
(venv) $ pylint --score=n --reports=n a.py
(venv) $ pylint --score=n --reports=n b.py
(venv) $ pylint -j 2 --score=n --reports=n a.py b.py
(venv) $ pylint -j 1 --score=n --reports=n a.py b.py
************* Module b
b.py:1:0: R0401: Cyclic import (a -> b) (cyclic-import)

@Pierre-Sassoulas
Copy link
Member

I can reproduce this with the latest version. Should be fixable by using the MapReduceMixin done by @doublethefish in #3458 that was only added to the duplicate checker.

@Pierre-Sassoulas
Copy link
Member

Closing as duplicate of #374

@Pierre-Sassoulas Pierre-Sassoulas added the Duplicate 🐫 Duplicate of an already existing issue label Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Duplicate 🐫 Duplicate of an already existing issue multiprocessing
Projects
None yet
Development

No branches or pull requests

4 participants