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

Import test apps on worker threads; Delete unused test files #436

Merged

Conversation

scottkurz
Copy link
Member

@scottkurz scottkurz commented Sep 14, 2023

A couple things going on here.

First, I got some failures on the Gradle setup, messages hinting at a deadlock. It seemed to suggest to me that maybe we shouldn't be doing the import from the main/UI thread. Reading the Gradle javadoc, it seemed the import stuff was long-running.
I decided to move this out into a non-UI thread. Since then I have not seen this deadlock issue (which isn't exactly proof that this change fixed it, but I'll take it as a good sign).

Second, I decided to do the same thing with Maven. As I was making this change, I was paying more attention to import, and I noticed some error messages that, however, did not seem to fail the tests.

Here's a sample snippet:

2023-09-14T15:56:29.9864219Z Exception in importMavenProjects importing project = resources/applications/maven/liberty-maven-test-app
2023-09-14T15:56:29.9878065Z org.eclipse.core.internal.resources.ResourceException(/liberty.maven.test.app/target)[374]: java.lang.Exception: Resource '/liberty.maven.test.app/target' already exists.
2023-09-14T15:56:29.9878837Z 	at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
2023-09-14T15:56:29.9879466Z 	at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
2023-09-14T15:56:29.9880035Z 	at org.eclipse.core.internal.resources.Resource.checkDoesNotExist(Resource.java:309)
2023-09-14T15:56:29.9880572Z 	at org.eclipse.core.internal.resources.Resource.checkDoesNotExist(Resource.java:296)
2023-09-14T15:56:29.9881092Z 	at org.eclipse.core.internal.resources.Folder.assertCreateRequirements(Folder.java:33)
2023-09-14T15:56:29.9881578Z 	at org.eclipse.core.internal.resources.Folder.create(Folder.java:94)
2023-09-14T15:56:29.9881999Z 	at org.eclipse.core.internal.resources.Folder.create(Folder.java:122)
2023-09-14T15:56:29.9882425Z 	at org.eclipse.m2e.core.internal.M2EUtils.createFolder(M2EUtils.java:61)
2023-09-14T15:56:29.9882999Z 	at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:87)
2023-09-14T15:56:29.9883678Z 	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$6(ProjectConfigurationManager.java:504)
2023-09-14T15:56:29.9884321Z 	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394)
2023-09-14T15:56:29.9884938Z 	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275)
2023-09-14T15:56:29.9885829Z 	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:498)
2023-09-14T15:56:29.9886668Z 	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.configureNewMavenProjects(ProjectConfigurationManager.java:279)
2023-09-14T15:56:29.9887401Z 	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$1(ProjectConfigurationManager.java:166)
2023-09-14T15:56:29.9888053Z 	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394)
2023-09-14T15:56:29.9888661Z 	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275)
2023-09-14T15:56:29.9889359Z 	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:214)
2023-09-14T15:56:29.9890002Z 	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:139)
2023-09-14T15:56:29.9890735Z 	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:130)
2023-09-14T15:56:29.9891488Z 	at io.openliberty.tools.eclipse.test.it.AbstractLibertyPluginSWTBotTest.importMavenProjects(AbstractLibertyPluginSWTBotTest.java:142)

I also noticed some issues setting up the DS componentry, like:

2023-09-14T15:45:20.1729520Z !ENTRY org.apache.felix.scr 4 0 2023-09-14 15:45:20.171
2023-09-14T15:45:20.1731265Z !MESSAGE bundle org.apache.felix.scr:2.2.6 (27) Circular reference detected trying to get service {org.eclipse.m2e.core.project.IMavenProjectChangedListener}={service.id=180, service.bundleid=19, service.scope=bundle, osgi.ds.satisfying.condition.target=(osgi.condition.id=true), component.name=org.eclipse.m2e.core.internal.project.WorkspaceStateWriter, component.id=12}
2023-09-14T15:45:20.1733064Z  stack of references: ServiceReference: {org.eclipse.m2e.core.project.IMavenProjectChangedListener}={service.id=180, service.bundleid=19, service.scope=bundle, osgi.ds.satisfying.condition.target=(osgi.condition.id=true), component.name=org.eclipse.m2e.core.internal.project.WorkspaceStateWriter, component.id=12}
2023-09-14T15:45:20.1734649Z ServiceReference: {org.eclipse.m2e.core.project.IMavenProjectRegistry}={service.id=176, service.bundleid=19, service.scope=bundle, osgi.ds.satisfying.condition.target=(osgi.condition.id=true), component.name=org.eclipse.m2e.core.internal.project.registry.MavenProjectManager, component.id=15}
2023-09-14T15:45:20.1735805Z     Dependency: DependencyManager: Component [Component: org.eclipse.m2e.core.embedder.MavenModelManager (1)] reference [projectManager]

I'm not sure how relevant these are. They seem to be present before and after this change here... and so ultimately without consequence.

I had a thought that I wondered if there might be some relevance to the #375 issue, but I guess there's still no reason to think so.

Finally, I simply deleted some old test parts that I think are now unused. I believe we deleted the test code that was trying to dynamically switch btw wrapper / non-wrapper and did the equivalent more statically (though I don't completely trust my memory, but I kind of recall this).

@scottkurz scottkurz force-pushed the import-gradle-test-app-on-worker-thread branch 2 times, most recently from 503a450 to 431030e Compare September 14, 2023 15:35
@scottkurz scottkurz force-pushed the import-gradle-test-app-on-worker-thread branch from 431030e to 0935ae2 Compare September 14, 2023 16:56
@scottkurz scottkurz changed the title Import test apps on worker threads Import test apps on worker threads; Delete unused test files Sep 14, 2023
Copy link
Contributor

@awisniew90 awisniew90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just one comment but nothing pressing.

// Get the list of projects to install.
MavenModelManager modelManager = MavenPlugin.getMavenModelManager();

for (String folder : folders) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for iterating over each folder rather than passing the folders list to the LocalProjectScanner?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just grasping and wondering if it would be more or less likely to hit something like the #375 issue.

It did not seem to eliminate some of the error messages I noted above so far...

@scottkurz scottkurz merged commit 7f10a8b into OpenLiberty:main Sep 15, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants