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

IOConsoleTests: AutoRegisterSchemeHandlersJob still running on I20240905-0340 MacOS #2245

Closed
jukzi opened this issue Sep 6, 2024 · 13 comments
Labels
bug Something isn't working macOS happens on macOS regression test junit test related things

Comments

@jukzi
Copy link
Contributor

jukzi commented Sep 6, 2024

https://download.eclipse.org/eclipse/downloads/drops4/I20240905-0340/testresults/html/org.eclipse.debug.tests_ep434I-unit-macM1-java17_macosx.cocoa.aarch64_17.html

org.opentest4j.MultipleFailuresError: Multiple Failures (2 failures)
java.lang.AssertionError: Test triggered errors in IOConsole
java.lang.AssertionError: Test triggered errors in IOConsole
Suppressed: java.lang.AssertionError: Test triggered errors in IOConsole
at org.eclipse.debug.tests.console.IOConsoleTests.lambda$1(IOConsoleTests.java:138)
at java.base/java.util.concurrent.ConcurrentLinkedQueue.forEachFrom(ConcurrentLinkedQueue.java:1037)
at java.base/java.util.concurrent.ConcurrentLinkedQueue.forEach(ConcurrentLinkedQueue.java:1054)
at org.eclipse.debug.tests.console.IOConsoleTests.assertNoError(IOConsoleTests.java:136)
at org.eclipse.debug.tests.console.IOConsoleTests.testBackspaceControlCharacter(IOConsoleTests.java:542)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
Caused by: 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.lang.String.substring(String.java:2710)
at java.base@17/java.lang.String.subSequence(String.java:2742)
at java.base@17/java.util.regex.Pattern.split(Pattern.java:1272)
at java.base@17/java.lang.String.split(String.java:3150)
at java.base@17/java.lang.String.split(String.java:3196)
at org.eclipse.urischeme.internal.registration.RegistrationMacOsX.determineHandlerLocation(RegistrationMacOsX.java:88)
at org.eclipse.urischeme.internal.registration.RegistrationMacOsX.getSchemesInformation(RegistrationMacOsX.java:67)
at org.eclipse.urischeme.AutoRegisterSchemeHandlersJob.run(AutoRegisterSchemeHandlersJob.java:84)
..

seems unclear to me if AutoRegisterSchemeHandlersJob is to slow or if there is another rootcause that failed the test

@jukzi jukzi added bug Something isn't working regression macOS happens on macOS test junit test related things labels Sep 6, 2024
@jukzi
Copy link
Contributor Author

jukzi commented Sep 6, 2024

@jukzi
Copy link
Contributor Author

jukzi commented Sep 6, 2024

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

@jukzi
Copy link
Contributor Author

jukzi commented Sep 6, 2024

@BeckerWdf could you please take a look, as you have recently worked on AutoRegisterSchemeHandlersJob on macos

@sratz
Copy link
Member

sratz commented Sep 6, 2024

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().

jukzi pushed a commit to jukzi/eclipse.platform that referenced this issue Sep 10, 2024
jukzi pushed a commit to eclipse-platform/eclipse.platform that referenced this issue Sep 10, 2024
@jukzi
Copy link
Contributor Author

jukzi commented Sep 10, 2024

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
...

@jukzi
Copy link
Contributor Author

jukzi commented Sep 13, 2024

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

jukzi pushed a commit to jukzi/eclipse.platform.ui that referenced this issue Sep 13, 2024
Pattern matching with String.split("-{80}\n") is quiet expensive
especially if the string contains more then 80 dashes in a row.

eclipse-platform#2245
jukzi pushed a commit that referenced this issue Sep 13, 2024
Pattern matching with String.split("-{80}\n") is quiet expensive
especially if the string contains more then 80 dashes in a row.

#2245
@jukzi
Copy link
Contributor Author

jukzi commented Sep 16, 2024

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

jukzi pushed a commit to jukzi/eclipse.platform that referenced this issue Sep 16, 2024
IOConsoleTests complained about still running
AutoRegisterSchemeHandlersJob on macOS

eclipse-platform/eclipse.platform.ui#2245
jukzi pushed a commit to eclipse-platform/eclipse.platform that referenced this issue Sep 16, 2024
IOConsoleTests complained about still running
AutoRegisterSchemeHandlersJob on macOS

eclipse-platform/eclipse.platform.ui#2245
jukzi pushed a commit to jukzi/eclipse.platform that referenced this issue Sep 18, 2024
defines a Jobfamily CONSOLE_JOB_FAMILY and only wait for that to fix
unrelated "AutoRegisterSchemeHandlersJob still running" error on MacOs
during I-Build

eclipse-platform/eclipse.platform.ui#2245
jukzi pushed a commit to jukzi/eclipse.platform that referenced this issue Sep 18, 2024
defines a Jobfamily CONSOLE_JOB_FAMILY and only wait for that to fix
unrelated "AutoRegisterSchemeHandlersJob still running" error on MacOs
during I-Build

eclipse-platform/eclipse.platform.ui#2245
jukzi pushed a commit to eclipse-platform/eclipse.platform that referenced this issue Sep 18, 2024
defines a Jobfamily CONSOLE_JOB_FAMILY and only wait for that to fix
unrelated "AutoRegisterSchemeHandlersJob still running" error on MacOs
during I-Build

eclipse-platform/eclipse.platform.ui#2245
@BeckerWdf
Copy link
Contributor

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.

BeckerWdf added a commit to BeckerWdf/eclipse.platform.ui that referenced this issue Sep 20, 2024
If the IDE is running in "Development Mode" it doesn't make sense to
run this registration job.

Contributes to:
eclipse-platform#2245
@jukzi
Copy link
Contributor Author

jukzi commented Sep 20, 2024

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)

@sratz
Copy link
Member

sratz commented Sep 20, 2024

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?

#1453 (comment) would be an option

@BeckerWdf
Copy link
Contributor

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:

return !(alreadyTriggered || Platform.getPreferencesService().getBoolean(UriSchemeExtensionReader.PLUGIN_ID,

@BeckerWdf
Copy link
Contributor

Another option would be in the same way as the WindowsDefender check does it:
See: #1685

BeckerWdf added a commit to BeckerWdf/eclipse.platform.ui that referenced this issue Sep 20, 2024
If the IDE is running in "Development Mode" it doesn't make sense to
run this registration job.

Contributes to:
eclipse-platform#2245
BeckerWdf added a commit to BeckerWdf/eclipse.platform.ui that referenced this issue Sep 20, 2024
If the IDE is running because we are executing automated tests it
doesn't make sense to run this registration job.

Fixes : eclipse-platform#2245
@BeckerWdf
Copy link
Contributor

#1453 (comment) would be an option

Done in #2306

BeckerWdf added a commit to BeckerWdf/eclipse.platform.ui that referenced this issue Sep 23, 2024
If the IDE is running in "Development Mode" it doesn't make sense to
run this registration job.

Contributes to:
eclipse-platform#2245
BeckerWdf added a commit to BeckerWdf/eclipse.platform.ui that referenced this issue Sep 24, 2024
If the IDE is running in "Development Mode" it doesn't make sense to
run this registration job.

Contributes to:
eclipse-platform#2245
BeckerWdf added a commit that referenced this issue Sep 24, 2024
If the IDE is running in "Development Mode" it doesn't make sense to
run this registration job.

Contributes to:
#2245
BeckerWdf added a commit to BeckerWdf/eclipse.platform.ui that referenced this issue Sep 24, 2024
If the IDE is running because we are executing automated tests it
doesn't make sense to run this registration job.

Fixes : eclipse-platform#2245
BeckerWdf added a commit to BeckerWdf/eclipse.platform.ui that referenced this issue Oct 4, 2024
If the IDE is running because we are executing automated tests it
doesn't make sense to run this registration job.

Fixes : eclipse-platform#2245
praveen-skp pushed a commit to praveen-skp/eclipse.platform.ui that referenced this issue Oct 14, 2024
If the IDE is running in "Development Mode" it doesn't make sense to
run this registration job.

Contributes to:
eclipse-platform#2245
praveen-skp pushed a commit to praveen-skp/eclipse.platform.ui that referenced this issue Oct 14, 2024
If the IDE is running because we are executing automated tests it
doesn't make sense to run this registration job.

Fixes : eclipse-platform#2245
lathapatil pushed a commit to lathapatil/eclipse.platform.ui that referenced this issue Oct 21, 2024
Pattern matching with String.split("-{80}\n") is quiet expensive
especially if the string contains more then 80 dashes in a row.

eclipse-platform#2245
lathapatil pushed a commit to lathapatil/eclipse.platform.ui that referenced this issue Oct 21, 2024
If the IDE is running in "Development Mode" it doesn't make sense to
run this registration job.

Contributes to:
eclipse-platform#2245
lathapatil pushed a commit to lathapatil/eclipse.platform.ui that referenced this issue Oct 21, 2024
If the IDE is running because we are executing automated tests it
doesn't make sense to run this registration job.

Fixes : eclipse-platform#2245
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macOS happens on macOS regression test junit test related things
Projects
None yet
Development

No branches or pull requests

3 participants