-
-
Notifications
You must be signed in to change notification settings - Fork 683
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
Semaphore causes AssertJ to hang indefinitely. #1966
Comments
Further investigation shows that AssertJ only hangs because of the name of the following method:
If the method is renamed, it does not hang.
|
Attempted fix for assertj#1966
@rdehuyss sorry for the late answer, I have finally took the time to look into it. The issue is caused by AssertJ executing the AssertJ looks for getter methods in two different ways:
The getter method is invoked multiple times to evaluate whether the field should be ignored and to get its value for comparison, it is assumed the getter method has no side effect (assumption obviously wrong in your case). One way to fix your issue without renaming the field (as you did) is to disable bare name getter usage with:
The default is to look for bare name getters which we changed a few months ago but I'm not completely sure it was a good idea (I'll discuss with the team to see if we agree reverting to disabling bare name getter by default). |
We are reverting to not look for bare name getters but for users who wants this behaviour simply call:
|
Just out of curiosity does this also mean that Java 14 records are not working? Asking since with some reflection it is quite easy to get the accessor methods for a |
Summary
I'm using Objects which contains
Semaphore
's. When using recursive comparison, AssertJ hangs indefinetly.I cannot use ReentrantLock because of non-ownership-release semantics.
Example
The text was updated successfully, but these errors were encountered: