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

ClassCastException AsyncCompletionProposalPopup in ContinuousTypingCompletionTest #1835

Open
jukzi opened this issue Dec 5, 2024 · 3 comments
Labels
bug Something isn't working regression Regression defect test junit test related things

Comments

@jukzi
Copy link
Contributor

jukzi commented Dec 5, 2024

ContinuousTypingCompletionTest.testContinousTypingSelectsTopProposal failed in
https://download.eclipse.org/eclipse/downloads/drops4/I20241204-1800/testresults/html/org.eclipse.jdt.text.tests_ep435I-unit-macosx-x86_64-java17_macosx.cocoa.x86_64_17.html

java.lang.ClassCastException: class org.eclipse.jface.text.contentassist.AsyncCompletionProposalPopup$ComputingProposal cannot be cast to class org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal (org.eclipse.jface.text.contentassist.AsyncCompletionProposalPopup$ComputingProposal is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @274d1785; org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @bad6718)
at org.eclipse.jdt.text.tests.contentassist.ContinuousTypingCompletionTest$CompletionSelectionTracker.getSelectedProposal(ContinuousTypingCompletionTest.java:60)
at org.eclipse.jdt.text.tests.contentassist.ContinuousTypingCompletionTest.testContinousTypingSelectsTopProposal(ContinuousTypingCompletionTest.java:87)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)

locally reproducable on win
image

cc @mickaelistria @testforstephen because you are working on classloader issues - any idea?

@jukzi jukzi added bug Something isn't working regression Regression defect test junit test related things labels Dec 5, 2024
@mickaelistria
Copy link
Contributor

This is a regular classCastException, not a classloader issue. ComputingProposal is not an instance of AbstractJavaCompletionProposal. The question is what has changed: is it that ComputingProposal is now returned (ie completion in JDT being async?) or that AbstractJavaCompletionProposal is freshly expected?

@jukzi
Copy link
Contributor Author

jukzi commented Dec 5, 2024

I could not find any recent change that made the test work again.

jukzi pushed a commit to jukzi/eclipse.jdt.ui that referenced this issue Dec 5, 2024
…1835

AsyncCompletionProposalPopup defers the actual
AbstractJavaCompletionProposal proposals. Test has to wait for async
proposals to be calculated.

eclipse-jdt#1835
@jukzi
Copy link
Contributor Author

jukzi commented Dec 5, 2024

it's a race condition. Probably something got faster or slower. Found a way to fix it by appropriate wait.

jukzi pushed a commit to jukzi/eclipse.jdt.ui that referenced this issue Dec 6, 2024
…1835

AsyncCompletionProposalPopup defers the actual
AbstractJavaCompletionProposal proposals. Test has to wait for async
proposals to be calculated.

eclipse-jdt#1835
jukzi pushed a commit that referenced this issue Dec 6, 2024
AsyncCompletionProposalPopup defers the actual
AbstractJavaCompletionProposal proposals. Test has to wait for async
proposals to be calculated.

#1835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Regression defect test junit test related things
Projects
None yet
Development

No branches or pull requests

2 participants