-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Different output with --jobs=1 and --jobs=2 #374
Comments
Original comment by Robert Spier (BitBucket: robert_spier): And here's the output with formatting fixed. $ venv/bin/pylint --jobs=2 --rcfile=$PWD/pylintrc app/codein app/melange app/soc app/summerofcode app/settings.py app/urls.py app/main.py tests pavement.py setup.py 2>&1 | head
$ venv/bin/pylint --jobs=1 --rcfile=$PWD/pylintrc app/codein app/melange app/soc app/summerofcode app/settings.py app/urls.py app/main.py tests pavement.py setup.py 2>&1 | head
|
Original comment by Robert Spier (BitBucket: robert_spier): FYI, I can also replicate this with the official 1.4.0 release. Although the output is slightly different. Running with --jobs=2 produces many more lint warnings than with --jobs=1. |
Original comment by Saulius Menkevičius (BitBucket: sauliusmenkevicius): Can confirm. For me, pylint seems to ignore the pylintrc file, even though it is specified via the I was using an older version of pylint (with support for --jobs) from |
Original comment by Pedro Algarvio (BitBucket: s0undt3ch, GitHub: @s0undt3ch?): I can also confirm this. I had custom plugins on the rcfile and they're not being loaded |
Original comment by Pedro Algarvio (BitBucket: s0undt3ch, GitHub: @s0undt3ch?): I'm also on 1.4.0 |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Yeah, --jobs is kind tricky right now, will try to fix asap. By the way, if you have any other problems with --jobs, it's better to open another ticket, so they could be tracked and fixed individually. |
Original comment by Pedro Algarvio (BitBucket: s0undt3ch, GitHub: @s0undt3ch?): I believe my problem is because the rcfile is being ignored. |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Merged in godfryd/pylint/fix-374 (pull request #213) Fixed passing configuration from master linter to sublinters. Closes issue #374. |
1 similar comment
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Merged in godfryd/pylint/fix-374 (pull request #213) Fixed passing configuration from master linter to sublinters. Closes issue #374. |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Fixed passing configuration from master linter to sublinters. Closes issue #374. |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Hm, the latest patch introduced another regression related to disabling messages from the pylintrc. |
Original comment by Michal Nowikowski (BitBucket: godfryd, GitHub: @godfryd?): How to reproduce that new problem? I run:
The outputs contain the same messages. pylintrc is disabling and enabling particular messages. |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Indeed, it was due to a faulty installation. Sorry about the noise. |
Original comment by Robert Spier (BitBucket: robert_spier): I confirm that it works correctly on the Melange codebase. The performance improvement from adding more jobs is not as high as expected. |
Original comment by Pavel Roskin (BitBucket: pavel_roskin): The issue with absolute_import may be resolved by pull request #229. The performance is discussed in issue #479. There are still issues with different output. Not sure if I should open another ticket. I'll describe it here. |
Original comment by Pavel Roskin (BitBucket: pavel_roskin): That's a minimal example showing that the issue is not fully resolved.
|
Original comment by James Broadhead (BitBucket: jamesbroadhead, GitHub: @jamesbroadhead?): Same here -- getting significantly more 'duplicate-code' & 'cyclic-import' with --jobs=1 over --jobs=2 Closed-source codebase, but I'm happy to run debug branches etc. over it. $ pylint --version |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Increasing to blocker, so that we'll have a fix finally in 1.5. |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): I'm trying to reproduce this issue, but unfortunately I can't reproduce Pavel's example using the latest code from the repository. Could anyone of you provide a more comprehensive example where this discrepancy happens? |
Original comment by Pavel Roskin (BitBucket: pavel_roskin): I tried pylint on the current python-ly, and I see that things have improved greatly. There are only two issues that the parallel pylint missed compared to the single-job version: One job:
Two jobs:
I actually prefer the later notation, it's more explicit that it's just the |
Original comment by Pavel Roskin (BitBucket: pavel_roskin): Here's a simple test for the module naming issue. It turns out the parallel version uses both names, which is bad.
|
Original comment by Pavel Roskin (BitBucket: pavel_roskin): Cyclic import problem
|
Original comment by Pavel Roskin (BitBucket: pavel_roskin): When running
The single-job version does not detect that condition. |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Thank you for the detailed reports, Pavel. Will look soon. |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Regarding |
Late to the game and new to pylint, and I feel I'm running into this issue. I'm a little confused, though, since even very simple cases seem to break with
I don't see a way this can be expected behavior. Am I missing something? Am I using the tool fundamentally wrong? |
Hi @rdadolf This bug is definitely irritating, I don't remember exactly why it got stuck, I should check again if it works. For me your example works perfectly. Do you have any pylintrc in that directory or somewhere else, which could potentially interfere with Pylint? I tried the same configuration, on Windows. Did you try on another OS? Does it work with multiple jobs and can you test with multiple files? |
I sometimes forget that there are developers who use non-unix systems. It's possible that differences in process scheduling are at play here. No other configuration files were in that directory, nor do I have a user-wide config file in my home directory. The system above was OS X 10.11.3 running an Anaconda version of python (as shown in the I just tried the same thing on an Ubuntu 15.10 machine which pylint was not previously installed. Used All values for Not sure what you mean by this last request, though:
The problem is identical for a multi-file module, if that's what you're asking. This setup:
I.e., a module with two source files and a simple
|
Adding a reproducer from a duplicate issue: Running
|
I'm sorry to unearth this, but
|
Which specific variant of duplicate code; in-file or across files? |
Only across files |
Can you share an example of two files that fail? I'll add it to the tests (which I am assuming are still working and do test -j2-10 on similar files). |
I guess there is nothing special about such files -- any similar lines in 2 files really:
same for bin/2.py.
|
I experience the same behaviour (Pylint At first I thought this was because input files were checked across different parallel workers, and therefore important context from a secondary file (e.g. duplicate code) was outside the context of the parallel worker. I don't think this is the case though; even when files are processed on the same worker (but jobs>1), the same behaviour is observed. I think this has more to do with the different ways in which files are handled between serial and parallel execution (determined by the number of jobs). For example, for files Another example not yet mentioned is '''
Docstring
'''
class Test:
'''
Test Class
'''
CLASS_ATTR = 5
'''
Docstring
'''
from test1 import Test
x = Test()
x.CLASS_ATTR = 3
|
I just lost a ton of time trying to debug why I was getting different results on CI than I was in any other environment even though the same Docker images were used both locally and on CI. Finally I found out it was because I had At the very least, I think the Parallel execution docs should include a big red flashing light to warn other developers who might get bitten by this. |
I've also been battling really odd behaviour in CI when everything was running fine locally (in docker or otherwise). Changing jobs to |
it's easy to repro:
pylint with 1 core (jobs==1) never has this issue, but is way too slow for large code bases |
Thanks to all for the reproducers. Futuring the Some of the other comments in this thread are either no longer reproducible, or expected to be fixed by merged PRs: 📚 🚨 Please help us test the pylint and astroid alphas! 🚨 📚 If you can reproduce any further indeterminacy with |
And the |
Originally reported by: Robert Spier (BitBucket: robert_spier)
Parallelism (--jobs) changes the output of pylint.
It's not just the order of the tests, --jobs=2 outputs 18468 lines of output compared to only 21 for --jobs=1. pylint 1.3.1 reports no lint errors.
$ venv/bin/pylint --jobs=2 --rcfile=$PWD/pylintrc app/codein app/melange app/soc app/summerofcode app/settings.py app/urls.py app/main.py tests pavement.py setup.py 2>&1 | head
************* Module codein.callback
W: 17, 0: import missing
from __future__ import absolute_import
(no-absolute-import)W: 18, 0: import missing
from __future__ import absolute_import
(no-absolute-import)W: 19, 0: import missing
from __future__ import absolute_import
(no-absolute-import)W: 20, 0: import missing
from __future__ import absolute_import
(no-absolute-import)************* Module codein.types
W: 17, 0: import missing
from __future__ import absolute_import
(no-absolute-import)W: 18, 0: import missing
from __future__ import absolute_import
(no-absolute-import)W: 20, 0: import missing
from __future__ import absolute_import
(no-absolute-import)W: 21, 0: import missing
from __future__ import absolute_import
(no-absolute-import)$ venv/bin/pylint --jobs=1 --rcfile=$PWD/pylintrc app/codein app/melange app/soc app/summerofcode app/settings.py app/urls.py app/main.py tests pavement.py setup.py 2>&1 | head
************* Module main
E: 46, 2: print statement used (print-statement)
E: 47, 2: print statement used (print-statement)
E: 48, 2: print statement used (print-statement)
E: 49, 2: print statement used (print-statement)
E: 50, 2: print statement used (print-statement)
************* Module tests.test_utils
E:658, 8: print statement used (print-statement)
E:662,10: print statement used (print-statement)
E:667, 8: print statement used (print-statement)
This is with the current head of the pylint repository. (1889:e404dd4d6e37 tip)
The source code being linted is https://code.google.com/p/soc/
The text was updated successfully, but these errors were encountered: