Skip to content

Conversation

@DaveCarpeneto
Copy link
Contributor

…rojects #2538

Change made since the fix to #1438 unintentionally removed the "refresh" contextual menu for resources that are not projects.

With this change the "refresh" contextual menu is shown if ANY navigator selection is either (A) an open project, or (B) a non-project resource. Put another way: the 'refresh' item is NOT shown if ALL selections are closed projects.

Fixes #2538

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2024

Test Results

 1 819 files   - 1   1 819 suites   - 1   1h 43m 11s ⏱️ + 12m 34s
 7 734 tests +5   7 506 ✅ +6  228 💤 ±0  0 ❌  - 1 
24 345 runs  ±0  23 596 ✅ +1  749 💤 ±0  0 ❌  - 1 

Results for commit 88557dd. ± Comparison against base commit 3325875.

♻️ This comment has been updated with latest results.

@jukzi
Copy link
Contributor

jukzi commented Dec 10, 2024

@mickaelistria can you review this? #2003 (comment)

@jukzi
Copy link
Contributor

jukzi commented Dec 10, 2024

The failing ProgressContantsTest.testKeepOneProperty is unrelated see #370

@mickaelistria
Copy link
Contributor

Code looks good and safe enough. However we didn't get any build completing from https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-2601/ , and I wouldn't feel comfortable merging until we have 1 build running entirely.
This is either a regression in performance (not necessarily related to this PR as some other PR builds sshow the same issue) or an infrastructure issue, but it's IMO worth blocking pending PRs until we can have reliable testing.

@jukzi
Copy link
Contributor

jukzi commented Dec 10, 2024

For the record: Build failed with OutOfMemoryError, i have not seen that elsewhere. @DaveCarpeneto can you help investigate the reason for OOME? May be its even related to this PR?

Exception in thread "WorkbenchTestable" org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.OutOfMemoryError: Java heap space)
	at org.eclipse.swt.SWT.error(SWT.java:4922)
	at org.eclipse.swt.SWT.error(SWT.java:4837)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:209)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
	at org.eclipse.swt.widgets.Display.syncExec(Unknown Source)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Testable.runTest(E4Testable.java:118)
	at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication.runTests(AbstractUITestApplication.java:38)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Testable.lambda$0(E4Testable.java:79)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.OutOfMemoryError: Java heap space
	at org.eclipse.swt.widgets.Synchronizer.asyncExec(Synchronizer.java:101)
	at org.eclipse.ui.internal.UISynchronizer.asyncExec(UISynchronizer.java:112)
	at org.eclipse.swt.widgets.Display.asyncExec(Display.java:931)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.lambda$1(HandledContributionItem.java:174)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$$Lambda$416/0x0000000800fca8b0.commandChanged(Unknown Source)
	at org.eclipse.core.commands.Command$1.run(Command.java:529)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.core.commands.Command.fireCommandChanged(Command.java:522)
	at org.eclipse.core.commands.Command.lambda$0(Command.java:1000)
	at org.eclipse.core.commands.Command$$Lambda$219/0x0000000800ed3328.handlerChanged(Unknown Source)
	at org.eclipse.core.commands.AbstractHandler.fireHandlerChanged(AbstractHandler.java:77)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.fireHandlerChanged(HandlerServiceHandler.java:189)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.handlerChanged(E4HandlerProxy.java:116)
	at org.eclipse.core.commands.AbstractHandler.fireHandlerChanged(AbstractHandler.java:77)
	at org.eclipse.ui.internal.handlers.HandlerProxy.lambda$0(HandlerProxy.java:242)
	at org.eclipse.ui.internal.handlers.HandlerProxy$$Lambda$280/0x0000000800f644d8.propertyChange(Unknown Source)
	at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:116)
	at org.eclipse.ui.internal.services.EvaluationReference.changed(EvaluationReference.java:100)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:105)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:358)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:374)
	at org.eclipse.ui.internal.services.EvaluationService$1.changed(EvaluationService.java:78)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:105)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:358)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:374)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.activate(EclipseContext.java:661)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.activateBranch(EclipseContext.java:670)
	at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener$1.run(ShellActivationListener.java:106)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.processWindow(ShellActivationListener.java:102)
	at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.handleEvent(ShellActivationListener.java:65)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)

@mickaelistria
Copy link
Contributor

The OutOfMemory seems to be already discussed in #2432

@iloveeclipse
Copy link
Member

@jukzi : regarding OOM: #2432. Would be nice if you could look at it if you have time.

@jukzi
Copy link
Contributor

jukzi commented Dec 10, 2024

The CI logfile contains messages like
org.eclipse.core.commands.NotHandledException: There is no handler to execute for command org.eclipse.ui.file.refresh)]

Running UiTestSuite org.eclipse.ui.tests.commands.CommandsTestSuite org.eclipse.ui.tests.commands.CommandExecutionTest
[(preExecute,
	ExecutionEvent(Command(org.eclipse.ui.file.refresh,Refresh,
		Refresh the selected items,
		Category(org.eclipse.ui.category.file,File,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.ui.file.refresh"),
		,,true),{},null,org.eclipse.core.expressions.EvaluationContext@94dad7b)), (notHandled,
	org.eclipse.core.commands.NotHandledException: There is no handler to execute for command org.eclipse.ui.file.refresh)]
[(preExecute,
	ExecutionEvent(Command(org.eclipse.ui.file.closePart,Close Part,
		Close the active workbench part,
		Category(org.eclipse.ui.category.window,Window,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.ui.file.closePart"),
		,,true),{},null,org.eclipse.core.expressions.EvaluationContext@599fb753)), (postExecuteSuccess,
	null)]
[(preExecute,
	ExecutionEvent(Command(org.eclipse.ui.file.closePart,Close Part,
		Close the active workbench part,
		Category(org.eclipse.ui.category.window,Window,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.ui.file.closePart"),
		,,true),{},null,org.eclipse.e4.core.commands.ExpressionContext@3fc2d0b1)), (postExecuteSuccess,
	null)]
[(preExecute,
	ExecutionEvent(Command(org.eclipse.ui.file.closePart,Close Part,
		Close the active workbench part,
		Category(org.eclipse.ui.category.window,Window,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.ui.file.closePart"),
		,,true),{},null,org.eclipse.core.expressions.EvaluationContext@69e6c4e4)), (postExecuteSuccess,
	null)]
[(preExecute,
	ExecutionEvent(Command(org.eclipse.ui.file.refresh,Refresh,
		Refresh the selected items,
		Category(org.eclipse.ui.category.file,File,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.ui.file.refresh"),
		,,true),{},null,org.eclipse.core.expressions.EvaluationContext@46264648)), (notHandled,
	org.eclipse.core.commands.NotHandledException: There is no handler to execute for command org.eclipse.ui.file.refresh)]
[(preExecute,
	ExecutionEvent(Command(org.eclipse.ui.file.refresh,Refresh,
		Refresh the selected items,
		Category(org.eclipse.ui.category.file,File,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.ui.file.refresh"),
		,,true),{},null,org.eclipse.e4.core.commands.ExpressionContext@7aa7a2e)), (notHandled,
	org.eclipse.core.commands.NotHandledException: There is no handler to execute for command org.eclipse.ui.file.refresh)]
[(preExecute,
	ExecutionEvent(Command(org.eclipse.ui.file.closeOthers,Close Others,
		Close all editors except the one that is active,
		Category(org.eclipse.ui.category.file,File,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.ui.file.closeOthers"),
		,,true),{},null,org.eclipse.core.expressions.EvaluationContext@4c121d2a)), (notEnabled,
	org.eclipse.core.commands.NotEnabledException: Trying to execute the disabled command org.eclipse.ui.file.closeOthers)]
[(preExecute,
	ExecutionEvent(Command(org.eclipse.ui.file.closeOthers,Close Others,
		Close all editors except the one that is active,
		Category(org.eclipse.ui.category.file,File,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.ui.file.closeOthers"),
		,,true),{},null,org.eclipse.e4.core.commands.ExpressionContext@38f216e6)), (notEnabled,
	org.eclipse.core.commands.NotEnabledException: Trying to execute the disabled command org.eclipse.ui.file.closeOthers)]
[(preExecute,
	ExecutionEvent(Command(org.eclipse.ui.file.closeOthers,Close Others,
		Close all editors except the one that is active,
		Category(org.eclipse.ui.category.file,File,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.ui.file.closeOthers"),
		,,true),{},null,org.eclipse.core.expressions.EvaluationContext@6cdd60dc)), (notEnabled,
	org.eclipse.core.commands.NotEnabledException: Trying to execute the disabled command org.eclipse.ui.file.closeOthers)]
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.163 s -- in UiTestSuite org.eclipse.ui.tests.commands.CommandsTestSuite org.eclipse.ui.tests.commands.CommandExecutionTest

does it relate to this PR?

@jukzi
Copy link
Contributor

jukzi commented Dec 10, 2024

i don't get if the added tests are useful: Only one of them fails when the PR is reverted and has an error message that is not understandable to me:

java.lang.AssertionError: Unexpected menu membership for org.eclipse.ui.RefreshAction (false)
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at org.eclipse.ui.tests.navigator.resources.ResourceMgmtActionProviderTests.checkMenuHasCorrectContributions(ResourceMgmtActionProviderTests.java:203)
	at org.eclipse.ui.tests.navigator.resources.ResourceMgmtActionProviderTests.testFillContextMenu_folderSelection(ResourceMgmtActionProviderTests.java:76)

@DaveCarpeneto
Copy link
Contributor Author

i don't get if the added tests are useful: Only one of them fails when the PR is reverted [...]

The one test that fails relates directly to the code change. The other 4 handle other situations where eclipse behaves as expected today. I added those 4 tests in the hope that future changes do not introduce a regression bug, like was done in the code added for #1438 .

[...] and has an error message that is not understandable to me:

java.lang.AssertionError: Unexpected menu membership for org.eclipse.ui.RefreshAction (false)
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at org.eclipse.ui.tests.navigator.resources.ResourceMgmtActionProviderTests.checkMenuHasCorrectContributions(ResourceMgmtActionProviderTests.java:203)
	at org.eclipse.ui.tests.navigator.resources.ResourceMgmtActionProviderTests.testFillContextMenu_folderSelection(ResourceMgmtActionProviderTests.java:76)

My hope was that the error message was enough that if this test failed that people investigating would have enough information to see what went wrong. In this case RefreshAction was not included, where the test was expecting to be included. If you feel that further elaboration is needed for a unit test failure message please let me know & I will submit another change to cover this.

@DaveCarpeneto
Copy link
Contributor Author

The CI logfile contains messages like org.eclipse.core.commands.NotHandledException: There is no handler to execute for command org.eclipse.ui.file.refresh)]
[...]
does it relate to this PR?

No. I see this in the stdout when I grab pretty much any recent build & run these tests (which succeed). The NotHandledException is in fact what was expected by the test. These lines come from things like the following in org.eclipse.ui.tests.commands.CommandExecutionTest :

System.out.println(listener.methods);

... which were added as part of the tests in 2012. These lines have been reported in builds for quite some time :-)

@DaveCarpeneto
Copy link
Contributor Author

Just checking to see if there's anything else of concern on this pull request. To recap responses to the previously-raised concerns:

  • the "OutOfMemoryError" is discussed @ OutOfMemoryError reported by jenkins validation build after org.eclipse.ui.tests.UiTestSuite #2432 (it's not me)
  • 1 of the added tests covers the specific change introduced here, the other 4 tests cover situations which were already working (these tests were added in the hope that future regressions do not get introduced)
  • the "NotHandledException" messages seen are from System.out.println() calls made in other tests which succeed. These log lines have been in the stdout from test runs for several years.

Thanks for all the feedback given thus far. Please do let me know if there's anything else I can do to get this into product, ideally for 2025-03 (the 1-year anniversary of the regression bug's introduction)

@merks
Copy link
Contributor

merks commented Dec 17, 2024

I think this error comes from your change:

09:20:29.764 [ERROR] /home/jenkins/agent/workspace/eclipse.platform.ui_PR-2601/tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/resources/ResourceMgmtActionProviderTests.java:92: error: bad HTML entity
09:20:29.764 [ERROR] 	 * 'build' & 'open project' should be enabled

Of course in Javadoc it should be &. Please do feel free to ping us so that this isn't forgotten!

@DaveCarpeneto
Copy link
Contributor Author

I think this error comes from your change:

09:20:29.764 [ERROR] /home/jenkins/agent/workspace/eclipse.platform.ui_PR-2601/tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/resources/ResourceMgmtActionProviderTests.java:92: error: bad HTML entity
09:20:29.764 [ERROR] 	 * 'build' & 'open project' should be enabled

Of course in Javadoc it should be &. Please do feel free to ping us so that this isn't forgotten!

Ouch. Yes. Fixed.

@jukzi
Copy link
Contributor

jukzi commented Dec 17, 2024

please rebase on master

@merks
Copy link
Contributor

merks commented Dec 17, 2024

Sorry we have so many "rules". But it helps to keep things clean:

https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md#creating-a-pull-request

E.g., we really would prefer that there is a single commit which generally involves amending and force pushing and you make changes (with the exception of version increments). So rebasing on master and squashing into a single commit would be good...

@merks
Copy link
Contributor

merks commented Dec 17, 2024

The failure looks unrelated to your changes.

15:30:56.765 [ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-p2-extras-plugin:4.0.10:compare-version-with-baselines (compare-attached-artifacts-with-release) on project org.eclipse.search.tests: Baseline and reactor have the same fully qualified version, but different content
15:30:56.765 [ERROR] different
15:30:56.765 [ERROR]    META-INF/ECLIPSE_.RSA: present in baseline only
15:30:56.765 [ERROR]    META-INF/ECLIPSE_.SF: present in baseline only
15:30:56.765 [ERROR] -> [Help 1]

I was going to rebase the branch, but it just now got rebased with a merge commit creating a 3rd commit; there's actually two choice on that green button and the first default one is not good. We definitely block merge commits.

Anyway, let's see a green build first....

@merks
Copy link
Contributor

merks commented Dec 17, 2024

The one failure is intimately familiar and goes away if we re-run it until it doesn't randomly fail:

Error: Failed to execute goal org.eclipse.tycho:tycho-apitools-plugin:4.0.10:verify (verify) on project org.eclipse.ui.views.log: Execute ApiApplication failed: InvocationTargetException: Component 'Log View' in the baseline 'workspace' is disposed [main]: Component was disposed here [Worker-2: Updating plug-in dependencies] -> [Help 1]

The other is because we don't allow merge commits:

Pull-Request Checks / check-merge-commits / Block Merge Commits (pull_request)

If we had this as a single commit based on master, I think all would be good, at least from a build point of view. I don't see that anyone has actually reviewed the code yet. 😞

@DaveCarpeneto
Copy link
Contributor Author

I don't see that anyone has actually reviewed the code yet

This was done in previously submitted pull requests. See comments in:

#2542

#2539

... the problem is that I'm not used to github & am making a mess of things as I go. As such when I'm told to put things into a single squashed commit it's less risky for me to just close the existing PR & open a new one. Apologies for the confusion this causes. DOing the best I can in a strange (to me) environment.

If we had this as a single commit based on master, I think all would be good, at least from a build point of view

As per the above: once people are comfy with everything in this PR I'll create another one with a single commit in it.

@merks
Copy link
Contributor

merks commented Dec 17, 2024

I'm not sure if you are using EGit in the IDE. What I do is rename my PR branch foo to foo-old. Then I check out master. Make sure I pull master. Then I create a new branch foo (name I used before for the PR) which is based on the update-to-date master. I make sure all my changes are in the workspace, I make a new commit onto the foo branch and I force push foo to my fork. This updates the existing PR that was created from foo. This will make everyone happier. If you mess it up, no one will die.

@DaveCarpeneto
Copy link
Contributor Author

DaveCarpeneto commented Dec 17, 2024

This will make everyone happier

The list of happier people includes me :-) Thank you for these instructions @merks - this matches what I did, minus the branch rename step.

I think I did this correctly? Please let me know if there's anything incorrect / needing changed from my end.

@merks
Copy link
Contributor

merks commented Dec 18, 2024

Yes, there is now a single commit on this existing PR. 😁

@jukzi
Copy link
Contributor

jukzi commented Dec 18, 2024

LGTM, i have restarted linux verify. once its green we can merge.

@merks
Copy link
Contributor

merks commented Dec 18, 2024

I guess we spin until the too familiar error is gone:

Error: Failed to execute goal org.eclipse.tycho:tycho-apitools-plugin:4.0.10:verify (verify) on project org.eclipse.e4.ui.swt.gtk: Execute ApiApplication failed: InvocationTargetException: Component 'Eclipse UI GTK Enhancements' in the baseline 'workspace' is disposed [main]: Component was disposed

@merks
Copy link
Contributor

merks commented Dec 18, 2024

@jukzi

I feel stupid, but I see now there is one test failure, rather an an API baseline disposed failure, but for the life of me I cannot find a link to navigate me to information about which test failed. Part of me says, hey, the jenkins build was good and it runs on Linux too, so what the heck is wrong with the github action for Linux. I expect you have more experience "reading the tea leaves" for this kind of thing. I would greatly appreciate if you explained how I locate the details for a case like this!!

@jukzi
Copy link
Contributor

jukzi commented Dec 18, 2024

the relevant jenkins job https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-2601/8/ is green so this seem to be an error, that that result is not forwared to github test results. lets rebase to get a new build.

…rojects eclipse-platform#2538

Change made since the fix to eclipse-platform#1438 unintentionally removed the "refresh" contextual menu for resources that are not projects.

With this change the "refresh" contextual menu is shown if ANY navigator selection is either (A) an open project, or (B) a non-project resource. Put another way: the 'refresh' item is NOT shown if ALL selections are closed projects.

Fixes eclipse-platform#2538
@merks
Copy link
Contributor

merks commented Dec 18, 2024

It just got 1 degree warmer in Switzerland and I see less snow on Mount Pilatus. On the plus side, I feel less stupid. 👿

@jukzi
Copy link
Contributor

jukzi commented Dec 18, 2024

The build failed again. Once the build is green this PR can be merged. Even though it is not contributors failure i can not spend my time in fixing the build. Please consider to help on improving the build process.

@merks
Copy link
Contributor

merks commented Dec 18, 2024

I'll kick it a few times, or until I scream, whichever comes first.

@merks
Copy link
Contributor

merks commented Dec 18, 2024

For future reference, if you ever want to update the branch, use the second (rebase) choice which is not the default so never just push the button:

image

Don't do it now or all the builds will start from scratch again!

@merks
Copy link
Contributor

merks commented Dec 18, 2024

I will run GHA for Linux one last time, and then I will merge this regardless of the outcome.

@vogella
Copy link
Contributor

vogella commented Dec 18, 2024

Failure is known #2603 and seem unrelated so Merging now should imho be fine

@merks merks merged commit b019337 into eclipse-platform:master Dec 18, 2024
16 of 17 checks passed
@merks
Copy link
Contributor

merks commented Dec 18, 2024

@DaveCarpeneto

Thank you for your contribution and your patience. 🏆

@DaveCarpeneto
Copy link
Contributor Author

@merks thanks for your patience :-)

@merks
Copy link
Contributor

merks commented Dec 18, 2024

@merks thanks for your patience :-)

Don't mistake persistence and perseverance for patience. They only look similar from the outside. 😱 😜

@DaveCarpeneto DaveCarpeneto deleted the issue2538b branch December 18, 2024 13:58
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.

Refresh option not available for some resources that are not closed projects

6 participants