Closed jukzi closed 1 month ago
https://download.eclipse.org/eclipse/downloads/drops4/I20240905-0340/testresults/ep434I-unit-mac64-java17_macosx.cocoa.x86_64_17/org.eclipse.debug.tests.AutomatedSuite.txt contains 1020 log entries like
Some job is still running or waiting to run:
'AutoRegisterSchemeHandlersJob(19)'/org.eclipse.urischeme.AutoRegisterSchemeHandlersJob
thread info: "Worker-2: AutoRegisterSchemeHandlersJob" prio=5 Id=45 RUNNABLE
@BeckerWdf could you please take a look, as you have recently worked on AutoRegisterSchemeHandlersJob on macos
The job itself has not been changed recently. But the job itself is rather expensive, especially on macOS.
It is scheduled in org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.initialize(IWorkbenchConfigurer)
, but this is unnecessarily expensive to do for each and every unit test.
I wonder if we could detect that we are running unit tests and not run the job in that case.
Additionally, we should probably also not run it in case of Platform.inDevelopmentMode()
.
Note that the failures also complain about CIRCULAR REFERENCE -whatever that means
Caused by: [CIRCULAR REFERENCE: java.lang.RuntimeException: Some job is still running or waiting to run:
'AutoRegisterSchemeHandlersJob(19)'/org.eclipse.urischeme.AutoRegisterSchemeHandlersJob
thread info: "Worker-2: AutoRegisterSchemeHandlersJob" prio=5 Id=47 RUNNABLE
at java.base@17/java.io.FileInputStream.readBytes(Native Method)
at java.base@17/java.io.FileInputStream.read(FileInputStream.java:276)
at java.base@17/java.io.BufferedInputStream.fill(BufferedInputStream.java:244)
at java.base@17/java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
at java.base@17/java.io.BufferedInputStream.read(BufferedInputStream.java:343)
- locked java.lang.ProcessImpl$ProcessPipeInputStream@56afbace
at java.base@17/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:270)
at java.base@17/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:313)
at java.base@17/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
- locked java.io.InputStreamReader@19565b5
...
unnecessarily expensive to do for each and every unit test.
As far as i understand the job is only scheduled once, but each tests complains about it is still running
in I20240914-1800 https://download.eclipse.org/eclipse/downloads/drops4/I20240914-1800/testresults/ep434I-unit-mac64-java17_macosx.cocoa.x86_64_17/org.eclipse.debug.tests.AutomatedSuite.txt the dumps are
java.lang.RuntimeException: Some job is still running or waiting to run:
'AutoRegisterSchemeHandlersJob(19)'/org.eclipse.urischeme.AutoRegisterSchemeHandlersJob
thread info: "Worker-2: AutoRegisterSchemeHandlersJob" prio=5 Id=45 RUNNABLE
at java.base@17/java.io.FileInputStream.readBytes(Native Method)
at java.base@17/java.io.FileInputStream.read(FileInputStream.java:276)
at java.base@17/java.io.BufferedInputStream.read1(BufferedInputStream.java:282)
at java.base@17/java.io.BufferedInputStream.read(BufferedInputStream.java:343)
- locked java.lang.ProcessImpl$ProcessPipeInputStream@2e2a2b07
at java.base@17/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:270)
at java.base@17/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:313)
at java.base@17/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
- locked java.io.InputStreamReader@3c00da24
at java.base@17/java.io.InputStreamReader.read(InputStreamReader.java:177)
...
the stack is not long enough to see where that job hangs - but probably during reading output of some lsregister
os command
I wonder if we could detect that we are running unit tests and not run the job in that case.
How could we detect his?
Additionally, we should probably also not run it in case of Platform.inDevelopmentMode().
That's a good idea.
https://download.eclipse.org/eclipse/downloads/drops4/I20240919-1840/testresults/html/org.eclipse.debug.tests_ep434I-unit-macM1-java17_macosx.cocoa.aarch64_17.html does not show such as fails anymore. however the logfile https://download.eclipse.org/eclipse/downloads/drops4/I20240919-1840/testresults/ep434I-unit-macM1-java17_macosx.cocoa.aarch64_17/org.eclipse.debug.tests.AutomatedSuite.txt still contains 1084 logs about
!STACK 0
java.lang.RuntimeException: Some job is still running or waiting to run:
'AutoRegisterSchemeHandlersJob(19)'/org.eclipse.urischeme.AutoRegisterSchemeHandlersJob:RUNNING
thread info: "Worker-2: AutoRegisterSchemeHandlersJob" prio=5 Id=48 RUNNABLE
at java.base@17/java.io.FileInputStream.readBytes(Native Method)
at java.base@17/java.io.FileInputStream.read(FileInputStream.java:276)
at java.base@17/java.io.BufferedInputStream.read1(BufferedInputStream.java:282)
at java.base@17/java.io.BufferedInputStream.read(BufferedInputStream.java:343)
- locked java.lang.ProcessImpl$ProcessPipeInputStream@340f4723
at java.base@17/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:270)
at java.base@17/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:313)
at java.base@17/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
- locked java.io.InputStreamReader@136d1d58
at java.base@17/java.io.InputStreamReader.read(InputStreamReader.java:177)
...
at org.eclipse.debug.tests.TestUtil.dumpRunningOrWaitingJobs(TestUtil.java:253)
at org.eclipse.debug.tests.TestUtil.waitForJobs(TestUtil.java:235)
at org.eclipse.debug.tests.TestUtil.waitForJobs(TestUtil.java:207)
at org.eclipse.debug.tests.TestUtil.cleanUp(TestUtil.java:57)
at org.eclipse.debug.tests.AbstractDebugTest.tearDown(AbstractDebugTest.java:64)
I wonder if we could detect that we are running unit tests and not run the job in that case.
How could we detect his?
https://github.com/eclipse-platform/eclipse.platform.ui/pull/1453#issuecomment-1943428622 would be an option
I wonder if we could detect that we are running unit tests and not run the job in that case.
Maybe we can set the "skipAutoRegistration" preference of the "org.eclipse.urischeme" during test execution. See: https://github.com/eclipse-platform/eclipse.platform.ui/blob/8df2017769466ee8993656468e7ccb8fc99a5228/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/AutoRegisterSchemeHandlersJob.java#L114
Another option would be in the same way as the WindowsDefender check does it: See: https://github.com/eclipse-platform/eclipse.platform.ui/pull/1685
#1453 (comment) would be an option
Done in https://github.com/eclipse-platform/eclipse.platform.ui/pull/2306
https://download.eclipse.org/eclipse/downloads/drops4/I20240905-0340/testresults/html/org.eclipse.debug.tests_ep434I-unit-macM1-java17_macosx.cocoa.aarch64_17.html
seems unclear to me if AutoRegisterSchemeHandlersJob is to slow or if there is another rootcause that failed the test