Bug 576238 - Bump EGit BREE to Java 11
Summary: Bump EGit BREE to Java 11
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Releng (show other bugs)
Version: 6.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 6.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-23 18:08 EDT by Thomas Wolf CLA
Modified: 2021-09-29 15:22 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wolf CLA 2021-09-23 18:08:13 EDT
JGit will move to BREE Java 11 with 6.0. EGit must follow.

* Update BREE in MANIFEST.MFs
* Update .classpath
* Update poms to use --release 11
* Use maven 3.8.2 and tycho 2.4.0
* Set default target in pom.xml to egit-4.17

Once the maven build works:

* Update all minimum versions in Require-Bundles in MANIFEST.MFs to the versions present in Eclipse 2020-09.
* Update wiki to mention minimum BREE Java 11 and Eclipse 2020-09 baseline.
* Update website/index.html of p2 repo to state that it requires at least
  Eclipse 2020-09.
Comment 1 Thomas Wolf CLA 2021-09-23 18:20:49 EDT
Problems so far:

1. EGit's root pom spcifies multiple environments for org.eclipse.tycho:target-
   platform-configuration. That doesn't work with Java 11: we end up with all
   SWT platform-dependent bundles (gtk, win32, cocoa) in the target platform,
   which results in compile-time error messages

   "The type org.eclipse.swt.widgets.Shell cannot be resolved. It is indirectly
    referenced from required .class files."

   Not specifying an environment at all works, but results in warnings that the
   build was platform-dependent.

2. On bundle org.eclipse.egit.core.junit, maven-surefire seems to fire up a
   JUnit 3 runner and then fails with "There are test failures":

[INFO] ------------< org.eclipse.egit:org.eclipse.egit.core.junit >------------
[INFO] Building EGit JUnit Support 6.0.0-SNAPSHOT                       [13/19]
[INFO] ---------------------------[ eclipse-plugin ]---------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ org.eclipse.egit.core.junit ---
[INFO] Deleting /Users/thomas/Git/egit/org.eclipse.egit.core.junit/target
[INFO] 
[INFO] --- tycho-packaging-plugin:2.4.0:build-qualifier (default-build-qualifier) @ org.eclipse.egit.core.junit ---
[INFO] The project's OSGi version is 6.0.0.202109232215
[INFO] 
[INFO] --- tycho-packaging-plugin:2.4.0:validate-id (default-validate-id) @ org.eclipse.egit.core.junit ---
[INFO] 
[INFO] --- tycho-packaging-plugin:2.4.0:validate-version (default-validate-version) @ org.eclipse.egit.core.junit ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) @ org.eclipse.egit.core.junit ---
[INFO] 
[INFO] --- target-platform-configuration:2.4.0:target-platform (default-target-platform) @ org.eclipse.egit.core.junit ---
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ org.eclipse.egit.core.junit ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/thomas/Git/egit/org.eclipse.egit.core.junit/src/main/resources
[INFO] 
[INFO] --- tycho-compiler-plugin:2.4.0:compile (default-compile) @ org.eclipse.egit.core.junit ---
[INFO] Compiling 5 source files to /Users/thomas/Git/egit/org.eclipse.egit.core.junit/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ org.eclipse.egit.core.junit ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/thomas/Git/egit/org.eclipse.egit.core.junit/src/test/resources
[INFO] 
[INFO] --- tycho-compiler-plugin:2.4.0:testCompile (default-testCompile) @ org.eclipse.egit.core.junit ---
[INFO] Compiling 5 source files to /Users/thomas/Git/egit/org.eclipse.egit.core.junit/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ org.eclipse.egit.core.junit ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
egit.test.tmpdir[default]: /Users/thomas/egit.test.tmpdir
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for EGit Parent 6.0.0-SNAPSHOT:
[INFO] 
[INFO] EGit Parent ........................................ SUCCESS [  0.205 s]
[INFO] EGit Target Platform Definition .................... SUCCESS [  0.087 s]
[INFO] Eclipse EGit ....................................... SUCCESS [  1.033 s]
[INFO] Git Team Provider (Core) ........................... SUCCESS [  2.317 s]
[INFO] Git Team Provider (UI) ............................. SUCCESS [  4.488 s]
[INFO] EGit Mylyn UI ...................................... SUCCESS [  0.473 s]
[INFO] Git Team Provider (Documentation) .................. SUCCESS [  0.902 s]
[INFO] Eclipse EGit Feature ............................... SUCCESS [  0.112 s]
[INFO] EGit Mylyn Feature ................................. SUCCESS [  0.055 s]
[INFO] Git Flow ........................................... SUCCESS [  0.227 s]
[INFO] Git Flow UI ........................................ SUCCESS [  0.414 s]
[INFO] Eclipse EGit Gitflow Feature ....................... SUCCESS [  0.042 s]
[INFO] EGit JUnit Support ................................. FAILURE [  1.747 s]
[INFO] GitFlow Test Plug-in ............................... SKIPPED
[INFO] Eclipse EGit Source Feature ........................ SKIPPED
[INFO] EGit P2 Repository ................................. SKIPPED
[INFO] EGit Core Test Plug-in ............................. SKIPPED
[INFO] EGit UI Test Plug-in ............................... SKIPPED
[INFO] EGit Mylyn UI Test Plug-in ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  42.966 s
[INFO] Finished at: 2021-09-24T00:15:46+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project org.eclipse.egit.core.junit: There are test failures.

The surefire report directory has a jvmRun.dump file containing

java.lang.IllegalStateException: Workspace is closed.
	at org.eclipse.core.resources.ResourcesPlugin.getWorkspace(ResourcesPlugin.java:432)
	at org.eclipse.egit.core.test.TestProject.<init>(TestProject.java:91)
	at org.eclipse.egit.core.test.TestProject.<init>(TestProject.java:78)
	at org.eclipse.egit.core.test.TestProject.<init>(TestProject.java:68)
	at org.eclipse.egit.core.test.TestProject.<init>(TestProject.java:64)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.base/java.lang.Class.newInstance(Class.java:584)
	at org.apache.maven.surefire.junit.PojoTestSet.<init>(PojoTestSet.java:68)
	at org.apache.maven.surefire.junit.JUnit3Provider.createTestSet(JUnit3Provider.java:127)
	at org.apache.maven.surefire.junit.JUnit3Provider.invoke(JUnit3Provider.java:112)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)

There should be no tests run in that bundle. It has a src folder that is marked as a test folder, though.
Comment 2 Thomas Wolf CLA 2021-09-24 11:47:11 EDT
(2) can be resolved by including a config in that bundle for maven-surefire-plugin with skipTests=true.

Then there are some more problems:

* Eclipse 2020-09 had a serious rendering bug in SWT on OS X that makes the
  git history view unusable. For running tests in a child Eclipse, one needs
  to use at least the egit-4.18 target. The maven build, however, should run
  against the baseline egit-4.17.

* Eclipse 2020-12 (egit-4.18) changed the title message of a TitleAreaDialog
  from Text to Label, which breaks our SWTBot tests that look for a Text widget.
  Eclipse 2021-09 then changed it back. So our tests for this message become
  dependent on the JFace version.

* Some other spurious test failures appear to occur more frequently and need
  to be worked around or fixed.
Comment 3 Eclipse Genie CLA 2021-09-24 12:27:35 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/185814
Comment 4 Thomas Wolf CLA 2021-09-24 12:31:32 EDT
Next problem: because of the major version bump, one cannot currently install EGit nightly into an Oomph-managed Eclipse instance without uninstalling the org.eclipse.oomph.setup.git bundle, which has an upper version bound 6.0.0 exclusive.
Comment 5 Thomas Wolf CLA 2021-09-25 18:05:06 EDT
(In reply to Thomas Wolf from comment #4)
> Next problem: because of the major version bump, one cannot currently
> install EGit nightly into an Oomph-managed Eclipse instance without
> uninstalling the org.eclipse.oomph.setup.git bundle, which has an upper
> version bound 6.0.0 exclusive.

Maybe it would be a good idea to announce the major version bump on cross-projects-issues-dev?
Comment 6 Thomas Wolf CLA 2021-09-25 18:24:55 EDT
The CI builds uncovered more problems. CI uses CentOS/gtk.

* NPE in SpellcheckableMessageArea.forceFocus(). It appears to be called even
  though the widget is disposed? Can be worked around easily, but it's strange.
  Relevant stack trace is

20:06:13  java.lang.NullPointerException
20:06:13  	at org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea.forceFocus(SpellcheckableMessageArea.java:720)
20:06:13  	at org.eclipse.swt.widgets.Control.setFocus(Control.java:5422)
20:06:13  	at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1616)
20:06:13  	at org.eclipse.swt.widgets.Control.fixFocus(Control.java:332)
20:06:13  	at org.eclipse.swt.widgets.Control.releaseWidget(Control.java:4727)
20:06:13  	at org.eclipse.swt.widgets.Composite.releaseWidget(Composite.java:1519)
...
20:06:13  	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:1505)
20:06:13  	at org.eclipse.swt.widgets.Canvas.releaseChildren(Canvas.java:279)
20:06:13  	at org.eclipse.swt.widgets.Decorations.releaseChildren(Decorations.java:486)
20:06:13  	at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:3249)
20:06:13  	at org.eclipse.swt.widgets.Widget.release(Widget.java:1247)
20:06:13  	at org.eclipse.swt.widgets.Control.release(Control.java:4704)
20:06:13  	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:529)
20:06:13  	at org.eclipse.swt.widgets.Shell.dispose(Shell.java:3170)
20:06:13  	at org.eclipse.jface.window.Window.close(Window.java:335)
20:06:13  	at org.eclipse.jface.dialogs.Dialog.close(Dialog.java:988)

* Hang in BranchAndResetActionTest. This is caused by our SWT tests running
  their own event loops. This of course cannot possibly work if there is an
  asyncExec queued that opens a modal dialog, which then will run its own event
  loop, leaving the test blocked.

This is conceptually broken in the EGit tests. It appears that the switch to Java 11 and the egit 4.17 target platform changes some timing/threading/job scheduling behaviour, and we now run into this even though we never did on Java 8 with the egit-4.6 target platform.

The only fix I see is to not run event loops in test code. It's dodgy anyway. Unfortunately, it means that some tests have to be changed. Instead of waiting for some EGit jobs or spinning event loops, they just have to use SWTBot to wait until the expected UI modifications occur. Getting this right is going to be an awful game of whack-a-mole.

* Bug in the history page: there is still one condition related to ref
  filtering in which the history view does not update, making a test (rightly)
  fail. Again, it's unclear why we didn't hit this problem earlier; again
  perhaps related to changed timing/threading/job scheduling.
Comment 7 Andrey Loskutov CLA 2021-09-26 02:50:06 EDT
(In reply to Thomas Wolf from comment #6)
> The CI builds uncovered more problems. CI uses CentOS/gtk.

Is this same CI setup as used for SDK tests? If not, may be you can look on SDK jobs setup (ask on platform releng list where it is). 

> * NPE in SpellcheckableMessageArea.forceFocus(). It appears to be called even
>   though the widget is disposed? Can be worked around easily, but it's
> strange.
>   Relevant stack trace is
> 
> 20:06:13  java.lang.NullPointerException
> 20:06:13  	at
> org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea.

As an experiment, would it also happen if the platform version is set to 4.21? Could be that the particular platform version has some bug fixed later.

In general, we run our application tests since long time on 4.15 & Java 11 on RHEL 7.4, without troubles from SWT point of view, and since few months on latest 4.21 builds, again, without problems. Overall test time around 20 hours. Also SDK platform tests that run on Centos don't show unexpected SWT problems. 

So I assume, many of egit troubles could be caused by SWTbot and/or custom UI loop used by tests.
Comment 8 Eclipse Genie CLA 2021-09-26 17:56:53 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/185839
Comment 9 Thomas Wolf CLA 2021-09-27 03:26:58 EDT
(In reply to Thomas Wolf from comment #5)
> Maybe it would be a good idea to announce the major version bump on
> cross-projects-issues-dev?

We should probably also contribute an EGit/JGit 6.0 to platform M1 or M2 to catch problems in downstream bundles early on.
Comment 10 Eclipse Genie CLA 2021-09-27 04:19:50 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/185846
Comment 11 Eclipse Genie CLA 2021-09-27 06:53:59 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/185853
Comment 12 Matthias Sohn CLA 2021-09-29 10:35:50 EDT
(In reply to Thomas Wolf from comment #5)
> (In reply to Thomas Wolf from comment #4)
> > Next problem: because of the major version bump, one cannot currently
> > install EGit nightly into an Oomph-managed Eclipse instance without
> > uninstalling the org.eclipse.oomph.setup.git bundle, which has an upper
> > version bound 6.0.0 exclusive.
> 
> Maybe it would be a good idea to announce the major version bump on
> cross-projects-issues-dev?

done: https://www.eclipse.org/lists/cross-project-issues-dev/msg18654.html
Comment 13 Eclipse Genie CLA 2021-09-29 13:44:44 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit-github/+/185951