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

Unable to run plug-in tests after opening Plugins tab #1250

Closed
iloveeclipse opened this issue Apr 24, 2024 · 10 comments · Fixed by #1251
Closed

Unable to run plug-in tests after opening Plugins tab #1250

iloveeclipse opened this issue Apr 24, 2024 · 10 comments · Fixed by #1251
Assignees
Labels
bug Something isn't working regression Regression defect
Milestone

Comments

@iloveeclipse
Copy link
Member

iloveeclipse commented Apr 24, 2024

I'm unable to run successfully plugins tests anymore after opening launch config dialog / Plugins tab.
If I run a test for the first time (without opening dialog) it works, but once the config is opened, it's over, it crashes with obscure errors.

Caused by: java.lang.IllegalStateException: The bundle activator for the org.eclipse.equinox.common bundle is not available.
	at org.eclipse.core.internal.runtime.DataArea.assertLocationInitialized(DataArea.java:52)
	at org.eclipse.core.internal.runtime.DataArea.getStateLocation(DataArea.java:141)
	at org.eclipse.core.internal.runtime.InternalPlatform.getStateLocation(InternalPlatform.java:544)
	at org.eclipse.core.runtime.Plugin.getStateLocation(Plugin.java:275)
	at org.eclipse.core.internal.resources.LocalMetaArea.<init>(LocalMetaArea.java:75)
	at org.eclipse.core.internal.resources.Workspace.<init>(Workspace.java:370)
	at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:568)
	at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:1)
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:947)
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:257)
	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:324)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:267)
	at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:545)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:833)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:571)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:825)
	... 61 more

I see that the launch config gets these (highly unexpected) lines added:

    <booleanAttribute key="default_auto_start" value="true"/>
    <intAttribute key="default_start_level" value="1"/>

Steps to reproduce:

Save this file to the org.eclipse.core.tests.resources/URIUtilTest.launch file

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
    <booleanAttribute key="append.args" value="true"/>
    <stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
    <booleanAttribute key="askclear" value="false"/>
    <booleanAttribute key="automaticAdd" value="true"/>
    <booleanAttribute key="automaticValidate" value="false"/>
    <stringAttribute key="bootstrap" value=""/>
    <stringAttribute key="checked" value="[NONE]"/>
    <booleanAttribute key="clearConfig" value="true"/>
    <booleanAttribute key="clearws" value="true"/>
    <booleanAttribute key="clearwslog" value="false"/>
    <stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
    <booleanAttribute key="default" value="true"/>
    <booleanAttribute key="includeOptional" value="true"/>
    <stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
    <booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
    <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
        <listEntry value="/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/URIUtilTest.java"/>
    </listAttribute>
    <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
        <listEntry value="1"/>
    </listAttribute>
    <stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
    <booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
    <stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
    <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
    <booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
    <booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
    <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
    <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.core.tests.filesystem.URIUtilTest"/>
    <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
    <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.core.tests.resources"/>
    <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
    <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.8 -Xms256m -Xmx4G -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true"/>
    <stringAttribute key="pde.version" value="3.3"/>
    <stringAttribute key="product" value="org.eclipse.sdk.ide"/>
    <booleanAttribute key="run_in_ui_thread" value="true"/>
    <booleanAttribute key="tracing" value="false"/>
    <booleanAttribute key="useCustomFeatures" value="false"/>
    <booleanAttribute key="useDefaultConfig" value="true"/>
    <booleanAttribute key="useDefaultConfigArea" value="false"/>
    <booleanAttribute key="useProduct" value="false"/>
</launchConfiguration>
  • Go to the URIUtilTest.java in the Package explorer, Debug As -> JUnit Plugin Test
  • Test runs just fine.
  • Open Debug -> Debug Configurations... dialog
  • "Apply" button is initially disabled.
  • Note, after selecting "Plugins" tab the "Apply" button gets enabled
  • "Apply and Debug" => kaboom.
  • Compare the changed launch file with previous state. It is changed in unexpected and wrong way.

Note, URIUtilTest is just an example, it affects actually any plugin test

Must be regression from #1233

@iloveeclipse iloveeclipse added bug Something isn't working regression Regression defect labels Apr 24, 2024
@iloveeclipse iloveeclipse added this to the 4.32 M2 milestone Apr 24, 2024
@iloveeclipse
Copy link
Member Author

@fedejeanne : please check.

@iloveeclipse iloveeclipse changed the title Unable to run headless tests Unable to run plug-in tests after opening Plugins tab Apr 24, 2024
@mickaelistria
Copy link
Contributor

I also reproduced the issue, changing default start level to 1 and setting auto-start to false allows to get things working.

iloveeclipse added a commit to iloveeclipse/eclipse.pde.ui that referenced this issue Apr 24, 2024
PluginsTab"

This change reverts main change from commit
98a5865 changes because it caused a
severe regression.

See eclipse-pde#1233

Fixes eclipse-pde#1250
@iloveeclipse
Copy link
Member Author

@fedejeanne : I plan to merge #1251 for the next IBuild (will be 4.32 M2) tomorrow, assuming there will be no fix available before 23:00 CET today.

@fedejeanne
Copy link
Contributor

@fedejeanne : I plan to merge #1251 for the next IBuild (will be 4.32 M2) tomorrow, assuming there will be no fix available before 23:00 CET today.

Thank you for the heads up and for looking into it! I was just looking into it but I couldn't reproduce the error. I'll perform the setup tasks and try again later (I need to leave the office in 2 minutes).

@fedejeanne
Copy link
Contributor

Quick update: I'm on

Version: 2024-06 (4.32)
Build id: I20240423-1800

And I can't reproduce the error. The .launch file remains unchanged after I run it and the button is not initially disabled in the dialog. I had to change the .launch file to use Java 17 manually though. If I left it with Java 21 then I saw the error in the run config, I changed in the dialog to use Java 17 and then the 2 lines were also added. But even though, the tests ran.

@iloveeclipse
Copy link
Member Author

Maybe this is something Linux specific, I don't know, I haven't debugged this.
I see the problem disappears with #1251.

You can try with any launch config that is created automatically. Compare the file content after creation and after opening the launch configurations dialog. You actually should see it immediately by the wrong defaults set in the dialog.
On 4.30 it looks like:
image
On latest master it looks like:
image

iloveeclipse added a commit to iloveeclipse/eclipse.pde.ui that referenced this issue Apr 24, 2024
PluginsTab"

This change reverts main change from commit
98a5865 changes because it caused a
severe regression.

See eclipse-pde#1233

Fixes eclipse-pde#1250
@fedejeanne
Copy link
Contributor

@iloveeclipse I'll try to reproduce it and fix it on my Linux machine later today then. Thanks for the details!

iloveeclipse added a commit to iloveeclipse/eclipse.pde.ui that referenced this issue Apr 24, 2024
PluginsTab"

This change reverts main change from commit
98a5865 changes because it caused a
severe regression.

See eclipse-pde#1233

Fixes eclipse-pde#1250
@fedejeanne
Copy link
Contributor

Another quick update: I was able to reproduce the error on Windows. I was blinded by the fact that the tests ran fine, but the console was showing errors and the Default start level and Default Auto-Start are definitely being set to 1 and true.

I'm looking into it right now.

fedejeanne added a commit to fedejeanne/eclipse.pde that referenced this issue Apr 24, 2024
If this method (or part of it) is run before the tab has been activated
then the default configuration passed as parameter will be modified and
incorrect values will be introduced.

This commit fixes a regression introduced in
98a5865

Fixes eclipse-pde#1250
@fedejeanne
Copy link
Contributor

@iloveeclipse I proposed a fix --> #1252

I tested the same scenarios that I tested in #1233 (see its section How to test) and I additionally made sure that the default values for the configuration that reaches the Plugins tab is now overwritten. More details in the (edited) description of the PR.

Hope this helps!

iloveeclipse added a commit that referenced this issue Apr 24, 2024
PluginsTab"

This change reverts main change from commit
98a5865 changes because it caused a
severe regression.

See #1233

Fixes #1250
@iloveeclipse iloveeclipse self-assigned this Apr 24, 2024
@iloveeclipse
Copy link
Member Author

Verified works again with I20240424-1800

fedejeanne added a commit to fedejeanne/eclipse.pde that referenced this issue Apr 26, 2024
If this method (or part of it) is run before the tab has been activated
then the default configuration passed as parameter will be modified and
incorrect values will be introduced.

This commit fixes a regression introduced in
98a5865

Fixes eclipse-pde#1250
fedejeanne added a commit to fedejeanne/eclipse.pde that referenced this issue May 6, 2024
If this method (or part of it) is run before the tab has been activated
then the default configuration passed as parameter will be modified and
incorrect values will be introduced.

This commit fixes a regression introduced in
98a5865

Fixes eclipse-pde#1250
fedejeanne added a commit to fedejeanne/eclipse.pde that referenced this issue May 6, 2024
If this method (or part of it) is run before the tab has been activated
then the default configuration passed as parameter will be modified and
incorrect values will be introduced.

Remove attributes in PDE launch configurations instead of explicitly
setting them to their default values

The attributes in  question are:
- DESELECTED_WORKSPACE_BUNDLES --> []
- USE_CUSTOM_FEATURES --> false
- SHOW_SELECTED_ONLY --> false
- INCLUDE_OPTIONAL --> true
- AUTOMATIC_ADD --> true

The reason to do this is that 2 launch configurations are considered
different if one of them explicitly sets an attribute to its default
value (because it then has 1 more attribute)

This commit fixes a regression introduced in
98a5865

Fixes eclipse-pde#1250
fedejeanne added a commit to fedejeanne/eclipse.pde that referenced this issue May 6, 2024
If this method (or part of it) is run before the tab has been activated
then the default configuration passed as parameter will be modified and
incorrect values will be introduced.

Remove attributes in PDE launch configurations instead of explicitly
setting them to their default values

The attributes in  question are:
- DESELECTED_WORKSPACE_BUNDLES --> []
- USE_CUSTOM_FEATURES --> false
- SHOW_SELECTED_ONLY --> false
- INCLUDE_OPTIONAL --> true
- AUTOMATIC_ADD --> true

The reason to do this is that 2 launch configurations are considered
different if one of them explicitly sets an attribute to its default
value (because it then has 1 more attribute)

This commit fixes a regression introduced in
98a5865

Fixes eclipse-pde#1250
fedejeanne added a commit to fedejeanne/eclipse.pde that referenced this issue Jul 31, 2024
If this method (or part of it) is run before the tab has been activated
then the default configuration passed as parameter will be modified and
incorrect values will be introduced.

Remove attributes in PDE launch configurations instead of explicitly
setting them to their default values

The attributes in  question are:
- DESELECTED_WORKSPACE_BUNDLES --> []
- USE_CUSTOM_FEATURES --> false
- SHOW_SELECTED_ONLY --> false
- INCLUDE_OPTIONAL --> true
- AUTOMATIC_ADD --> true

The reason to do this is that 2 launch configurations are considered
different if one of them explicitly sets an attribute to its default
value (because it then has 1 more attribute)

This commit fixes a regression introduced in
98a5865

Fixes eclipse-pde#1250
fedejeanne added a commit to fedejeanne/eclipse.pde that referenced this issue Jul 31, 2024
If this method (or part of it) is run before the tab has been activated
then the default configuration passed as parameter will be modified and
incorrect values will be introduced.

Remove attributes in PDE launch configurations instead of explicitly
setting them to their default values

The attributes in  question are:
- DESELECTED_WORKSPACE_BUNDLES --> []
- USE_CUSTOM_FEATURES --> false
- SHOW_SELECTED_ONLY --> false
- INCLUDE_OPTIONAL --> true
- AUTOMATIC_ADD --> true

The reason to do this is that 2 launch configurations are considered
different if one of them explicitly sets an attribute to its default
value (because it then has 1 more attribute)

This commit fixes a regression introduced in
98a5865

Fixes eclipse-pde#1250
fedejeanne added a commit to fedejeanne/eclipse.pde that referenced this issue Jul 31, 2024
If this method (or part of it) is run before the tab has been activated
then the default configuration passed as parameter will be modified and
incorrect values will be introduced.

Remove attributes in PDE launch configurations instead of explicitly
setting them to their default values

The attributes in  question are:
- DESELECTED_WORKSPACE_BUNDLES --> []
- USE_CUSTOM_FEATURES --> false
- SHOW_SELECTED_ONLY --> false
- INCLUDE_OPTIONAL --> true
- AUTOMATIC_ADD --> true

The reason to do this is that 2 launch configurations are considered
different if one of them explicitly sets an attribute to its default
value (because it then has 1 more attribute)

This commit fixes a regression introduced in
98a5865

Fixes eclipse-pde#1250
HannesWell pushed a commit to fedejeanne/eclipse.pde that referenced this issue Jul 31, 2024
If this method (or part of it) is run before the tab has been activated
then the default configuration passed as parameter will be modified and
incorrect values will be introduced.

Remove attributes in PDE launch configurations instead of explicitly
setting them to their default values

The attributes in  question are:
- DESELECTED_WORKSPACE_BUNDLES --> []
- USE_CUSTOM_FEATURES --> false
- SHOW_SELECTED_ONLY --> false
- INCLUDE_OPTIONAL --> true
- AUTOMATIC_ADD --> true

The reason to do this is that 2 launch configurations are considered
different if one of them explicitly sets an attribute to its default
value (because it then has 1 more attribute)

This commit fixes a regression introduced in
98a5865

Fixes eclipse-pde#1250
fedejeanne added a commit to fedejeanne/eclipse.pde that referenced this issue Sep 5, 2024
If this method (or part of it) is run before the tab has been activated
then the default configuration passed as parameter will be modified and
incorrect values will be introduced.

Remove attributes in PDE launch configurations instead of explicitly
setting them to their default values

The attributes in  question are:
- DESELECTED_WORKSPACE_BUNDLES --> []
- USE_CUSTOM_FEATURES --> false
- SHOW_SELECTED_ONLY --> false
- INCLUDE_OPTIONAL --> true
- AUTOMATIC_ADD --> true

The reason to do this is that 2 launch configurations are considered
different if one of them explicitly sets an attribute to its default
value (because it then has 1 more attribute)

This commit fixes a regression introduced in
98a5865

Fixes eclipse-pde#1250
fedejeanne added a commit to fedejeanne/eclipse.pde that referenced this issue Sep 11, 2024
If this method (or part of it) is run before the tab has been activated
then the default configuration passed as parameter will be modified and
incorrect values will be introduced.

Remove attributes in PDE launch configurations instead of explicitly
setting them to their default values

The attributes in  question are:
- DESELECTED_WORKSPACE_BUNDLES --> []
- USE_CUSTOM_FEATURES --> false
- SHOW_SELECTED_ONLY --> false
- INCLUDE_OPTIONAL --> true
- AUTOMATIC_ADD --> true

The reason to do this is that 2 launch configurations are considered
different if one of them explicitly sets an attribute to its default
value (because it then has 1 more attribute)

This commit fixes a regression introduced in
98a5865

Fixes eclipse-pde#1250
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
Projects
None yet
3 participants