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

ExportBundleTests.testExport14Environment fails since I20240515-1800 #1272

Closed
jukzi opened this issue May 16, 2024 · 6 comments · Fixed by eclipse-equinox/p2#518
Closed

ExportBundleTests.testExport14Environment fails since I20240515-1800 #1272

jukzi opened this issue May 16, 2024 · 6 comments · Fixed by eclipse-equinox/p2#518
Assignees
Labels
bug Something isn't working regression Regression defect test Test case failure
Milestone

Comments

@jukzi
Copy link
Contributor

jukzi commented May 16, 2024

same error on all OS

java.lang.AssertionError: Export job had errors
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.assertTrue(Assert.java:42)
at org.eclipse.pde.ui.tests.ee.ExportBundleTests.testExport14Environment(ExportBundleTests.java:203)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)

https://download.eclipse.org/eclipse/downloads/drops4/I20240515-1800/testresults/html/org.eclipse.pde.ui.tests_ep432I-unit-win32-java17_win32.win32.x86_64_17.html

I don't know how to run that test locally:

org.junit.AssumptionViolatedException: Not running in a standalone Eclipse SDK
	at org.eclipse.pde.ui.tests.PDETestCase.assumeRunningInStandaloneEclipseSDK(PDETestCase.java:174)
	at org.eclipse.pde.ui.tests.ee.ExportBundleTests.requireStandaloneEclipseSDKEnvironment(ExportBundleTests.java:54)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)

@jukzi jukzi added bug Something isn't working test Test case failure regression Regression defect labels May 16, 2024
@iloveeclipse
Copy link
Member

I'm pretty sure the test should be updated once again after the fix for #1271.
I plan to take a look today.

@iloveeclipse
Copy link
Member

I see both tests in ExportBundleTests fail with errors complaining about not found ant support libraries, in particular

!ENTRY org.eclipse.ant.core 4 3 2024-05-16 13:41:46.355
!MESSAGE The library "jdtCompilerAdapter.jar" specified from "org.eclipse.jdt.core" for the antTasks extension does not exist

Here is the full output from one test:

!ENTRY org.eclipse.pde.ui.tests 1 0 2024-05-16 13:41:38.726
!MESSAGE [testExportCustomEnvironment] setUp

!ENTRY org.eclipse.ant.core 4 3 2024-05-16 13:41:46.352
!MESSAGE The library "buildTools.jar" specified from "org.eclipse.build.tools" for the antTasks extension does not exist

!ENTRY org.eclipse.ant.core 4 3 2024-05-16 13:41:46.355
!MESSAGE The library "jdtCompilerAdapter.jar" specified from "org.eclipse.jdt.core" for the antTasks extension does not exist

!ENTRY org.eclipse.ant.core 4 3 2024-05-16 13:41:46.355
!MESSAGE The library "jdtCompilerAdapter.jar" specified from "org.eclipse.jdt.core" for the antTasks extension does not exist

!ENTRY org.eclipse.ant.core 4 3 2024-05-16 13:41:46.357
!MESSAGE The library "comparatorSummary.jar" specified from "org.eclipse.releng.build.tools.comparator" for the antTasks extension does not exist

!ENTRY org.eclipse.ant.core 4 3 2024-05-16 13:41:46.357
!MESSAGE The library "convert.jar" specified from "org.eclipse.releng.build.tools.convert" for the antTasks extension does not exist

!ENTRY org.eclipse.ant.core 4 3 2024-05-16 13:41:46.358
!MESSAGE The library "buildTools.jar" specified from "org.eclipse.build.tools" for the extraClasspathEntries extension does not exist

!ENTRY org.eclipse.ant.core 4 3 2024-05-16 13:41:46.358
!MESSAGE The library "jdtCompilerAdapter.jar" specified from "org.eclipse.jdt.core" for the extraClasspathEntries extension does not exist

!ENTRY org.eclipse.ant.core 4 3 2024-05-16 13:41:46.359
!MESSAGE The library "comparatorSummary.jar" specified from "org.eclipse.releng.build.tools.comparator" for the extraClasspathEntries extension does not exist

!ENTRY org.eclipse.ant.core 4 3 2024-05-16 13:41:46.359
!MESSAGE The library "convert.jar" specified from "org.eclipse.releng.build.tools.convert" for the extraClasspathEntries extension does not exist
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.eclipse.ant.internal.core.ant.InternalAntRunner (file:/data/git/eclipse.platform/ant/org.eclipse.ant.core/lib/antsupportlib.jar)
WARNING: Please consider reporting this to the maintainers of org.eclipse.ant.internal.core.ant.InternalAntRunner
WARNING: System::setSecurityManager will be removed in a future release
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.eclipse.ant.internal.core.ant.InternalAntRunner (file:/data/git/eclipse.platform/ant/org.eclipse.ant.core/lib/antsupportlib.jar)
WARNING: Please consider reporting this to the maintainers of org.eclipse.ant.internal.core.ant.InternalAntRunner
WARNING: System::setSecurityManager will be removed in a future release

!ENTRY org.eclipse.ant.core 4 1 2024-05-16 13:42:06.730
!MESSAGE /data/junit-workspace/.metadata/.plugins/org.eclipse.pde.core/temp/org.eclipse.pde.container.feature/compile.org.eclipse.pde.container.feature.xml:4: The following error occurred while executing this line:
/data/junit-workspace/no.sound.export/build.xml:148: The following error occurred while executing this line:
/data/junit-workspace/no.sound.export/build.xml:109: Class not found: org.eclipse.jdt.core.JDTCompilerAdapter
!STACK 0
/data/junit-workspace/.metadata/.plugins/org.eclipse.pde.core/temp/org.eclipse.pde.container.feature/compile.org.eclipse.pde.container.feature.xml:4: The following error occurred while executing this line:
/data/junit-workspace/no.sound.export/build.xml:148: The following error occurred while executing this line:
/data/junit-workspace/no.sound.export/build.xml:109: Class not found: org.eclipse.jdt.core.JDTCompilerAdapter
	at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:582)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
	at org.apache.tools.ant.Task.perform(Task.java:350)
	at org.apache.tools.ant.Target.execute(Target.java:449)
	at org.apache.tools.ant.Target.performTasks(Target.java:470)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:34)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:714)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:530)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:369)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.runScript(FeatureExportOperation.java:476)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.doExport(FeatureExportOperation.java:314)
	at org.eclipse.pde.internal.core.exports.FeatureBasedExportOperation.run(FeatureBasedExportOperation.java:63)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: /data/junit-workspace/no.sound.export/build.xml:148: The following error occurred while executing this line:
/data/junit-workspace/no.sound.export/build.xml:109: Class not found: org.eclipse.jdt.core.JDTCompilerAdapter
	at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:582)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
	at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
	at jdk.internal.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
	at org.apache.tools.ant.Task.perform(Task.java:350)
	at org.apache.tools.ant.Target.execute(Target.java:449)
	at org.apache.tools.ant.Target.performTasks(Target.java:470)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
	at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
	at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:32)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
	... 25 more
Caused by: /data/junit-workspace/no.sound.export/build.xml:109: Class not found: org.eclipse.jdt.core.JDTCompilerAdapter
	at org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:266)
	at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.resolveClassName(CompilerAdapterFactory.java:257)
	at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:218)
	at org.apache.tools.ant.taskdefs.Javac.findSupportedFileExtensions(Javac.java:1181)
	at org.apache.tools.ant.taskdefs.Javac.scanDir(Javac.java:1119)
	at org.apache.tools.ant.taskdefs.Javac.collectFileListFromSourcePath(Javac.java:1149)
	at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:1086)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
	at jdk.internal.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
	at org.apache.tools.ant.Task.perform(Task.java:350)
	at org.apache.tools.ant.Target.execute(Target.java:449)
	at org.apache.tools.ant.Target.performTasks(Target.java:470)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
	at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
	at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:32)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
	... 39 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.core.JDTCompilerAdapter
	at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1402)
	at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1357)
	at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1112)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:467)
	at org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:254)
	... 58 more

!ENTRY org.eclipse.pde.ui.tests 1 0 2024-05-16 13:42:22.053
!MESSAGE [testExportCustomEnvironment] tearDown

iloveeclipse added a commit to iloveeclipse/p2 that referenced this issue May 16, 2024
@jukzi
Copy link
Contributor Author

jukzi commented May 16, 2024

i have seen "Class not found: org.eclipse.jdt.core.JDTCompilerAdapter" in console output during the ant build locally too

@iloveeclipse
Copy link
Member

I'm pretty sure the test should be updated once again after the fix for #1271.

Not quite right guessed. The problem is caused by #1271 but the fix must be done not in the test.

I can't reproduce it locally. However, the log file from SDK contains stack trace:

!ENTRY org.eclipse.pde.ui.tests 1 0 2024-05-16 00:17:38.342
!MESSAGE [testExport14Environment] setUp

!ENTRY org.eclipse.core.jobs 4 2 2024-05-16 00:17:43.857
!MESSAGE An internal error occurred during: "Test-Export".
!STACK 0
java.lang.NullPointerException: Cannot invoke "java.util.Dictionary.get(Object)" because "manifest" is null
	at org.eclipse.pde.internal.publishing.Utils.getBundleManifestHeader(Utils.java:107)
	at org.eclipse.pde.internal.build.BundleHelper.getManifestHeader(BundleHelper.java:222)
	at org.eclipse.pde.internal.build.site.PDEState.rememberManifestEntries(PDEState.java:195)
	at org.eclipse.pde.internal.build.site.PDEState.<init>(PDEState.java:109)
	at org.eclipse.pde.internal.build.site.BuildTimeSite.getRegistry(BuildTimeSite.java:144)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generateFeatures(BuildScriptGenerator.java:288)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generate(BuildScriptGenerator.java:147)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.doExport(FeatureExportOperation.java:310)
	at org.eclipse.pde.internal.core.exports.FeatureBasedExportOperation.run(FeatureBasedExportOperation.java:63)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

!ENTRY org.eclipse.pde.ui.tests 1 0 2024-05-16 00:17:44.031
!MESSAGE [testExport14Environment] tearDown

And that shows on the problem in the new code added with 2afa4d3.
PR will be there in a moment.

@HannesWell
Copy link
Member

Thank you Andrey for providing a fix.

I'm pretty sure the test should be updated once again after the fix for #1271.

Not quite right guessed. The problem is caused by #1271 but the fix must be done not in the test.

But wouldn't it be better do just not call rememberManifestEntries() if the manifest could not be loaded and is therefore null(From looking at the code of PDEState.basicLoadManifest() I guess that manifest becomes null for some kind of exotic bundle that does not have a MANIFEST.MF):

for (BundleDescription bundle : state.getBundles()) {
	Dictionary<String, String> manifest = loadManifest(new File(bundle.getLocation()));
	if (manifest !=null) {
		rememberManifestEntries(bundle, manifest, MANIFEST_ENTRIES);
	}
}

If manifest is null nothing is done anyways. I can provide a PR to adjust that, I'm just wonder if there are reasons speaking against it?

@iloveeclipse
Copy link
Member

If manifest is null nothing is done anyways. I can provide a PR to adjust that, I'm just wonder if there are reasons speaking against it?

I've analyzed where and who uses all that code related to NPE and my conclusion was that it would be better to fix it at lower level, because all the upper layers were fine with checking "null" responses. And because I also had no clue about all the other processing around bundles in the new PDE code I've therefore decided to fix it in p2.

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 Test case failure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants