-
Notifications
You must be signed in to change notification settings - Fork 660
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 results depending on --threads option #6939
Comments
Hey @dzentota, can you reproduce the issue on https://psalm.dev ? |
This has forced our project to switch to the much slower |
Ideally, we would need a reproducible case with a very small project, but this will be tough due to the nature of the issue. |
We had something very similar to this issue recently when upgrading Psalm. Turned out for us to be caused by a return typehint stating nullable, whereas the docblock return was a constant glob with no null value, and the method in question also did not return null at any point. It failed silently for us when https://psalm.dev/r/44db48d2c8 I only bring this up because those errors you're seeing might lead you to something silly like this in your codebase where this wasn't an issue in a previous Psalm version but may have started after an upgrade and is only visible when using multi-threading. Hopefully it points you to the right solution. That said it is curious that the function gets the warning in my example, but the class method does not. |
I found these snippets: https://psalm.dev/r/44db48d2c8<?php
class Test
{
public const TEST_1 = '1';
public const TEST_2 = '2';
public const TEST_3 = '3';
public const TEST_4 = '4';
public const TEST_5 = '5';
}
class Test2
{
/**
* @return Test::TEST_*
*/
public function test(): ?string {
return Test::TEST_2;
}
}
/**
* @return Test::TEST_*
*/
function test(): ?string {
return Test::TEST_1;
}
$test2 = new Test2();
$test2->test();
test();
|
This class of issues should be fixed with Psalm v5. |
@danog , which one are you referring to? All issues related to
A few observations:
|
This is probably just a missing issue key, not a big deal/bug thankfully. |
Actually let's open a new issue for this one, because this issue was probably originally caused by (now-fixed) mutability bugs, not by missing issue keys. |
We have a big project with a legacy code. Psalm produces different results depending on the
--threads
option we provide.Initially, we've added all the found issues to the baseline (using the default number of threads, 16 in my case). Then I try to run:
first run
second run
third run
fourth run
Note:
As you can see only 3) and 4) have the same results, while the same number of threads was in 1) 3) 4)
The text was updated successfully, but these errors were encountered: