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

SaveParticipantTest.testFormatChange* failed with additional whitespace #1445

Open
jukzi opened this issue Jun 10, 2024 · 5 comments
Open

SaveParticipantTest.testFormatChange* failed with additional whitespace #1445

jukzi opened this issue Jun 10, 2024 · 5 comments
Labels
test junit test related things

Comments

@jukzi
Copy link
Contributor

jukzi commented Jun 10, 2024

SaveParticipantTest

4 fails in https://download.eclipse.org/eclipse/downloads/drops4/I20240608-0320/testresults/html/org.eclipse.jdt.ui.tests_ep433I-unit-mac64-java17_macosx.cocoa.x86_64_17.html
for example:

expected:<... { String s [= (String) ]o; } }> but was:<... { String s [ = (String)]o; } }>

org.junit.ComparisonFailure: expected:<... {
String s [= (String) ]o;
}
}> but was:<... {
String s [ = (String)]o;
}
}>
at org.junit.Assert.assertEquals(Assert.java:117)
at org.junit.Assert.assertEquals(Assert.java:146)
at org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.testFormatChanges01(SaveParticipantTest.java:152)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)

image

@jukzi jukzi added the test junit test related things label Jun 10, 2024
@jukzi
Copy link
Contributor Author

jukzi commented Jun 10, 2024

Locally randomly reproducible sometimes on various test methods. examples:
image
image

@jukzi jukzi added the macOS happens on macOS label Jun 20, 2024
@jukzi
Copy link
Contributor Author

jukzi commented Jun 20, 2024

duplicate: #79 (also only mac)

@jukzi
Copy link
Contributor Author

jukzi commented Jun 20, 2024

single test fail on linux:
https://download.eclipse.org/eclipse/downloads/drops4/I20240619-1800/testresults/html/org.eclipse.jdt.ui.tests_ep433I-unit-cen64-gtk3-java21_linux.gtk.x86_64_21.html

expected:<...* A block comment on[] two lines */ ...> but was:<...* A block comment on[ * ] two lines */ ...>

org.junit.ComparisonFailure: expected:<...* A block comment on[] two lines
*/

...> but was:<...* A block comment on[
* ] two lines
*/

...>
at org.junit.Assert.assertEquals(Assert.java:117)
at org.junit.Assert.assertEquals(Assert.java:146)
at org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.testBug232768_2(SaveParticipantTest.java:790)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)

@jukzi jukzi removed the macOS happens on macOS label Jun 20, 2024
@carstenartur
Copy link
Contributor

I think that is an old one. A number of reasons are possible. One could be that the formatting and compiler settings data structure gets duplicated in some situations. So working on a copy in some threads is not thread save. When changes are applied at runtime the question is which set of options is changed. That is a bug in jdt core. That is from the top of my head - could be in the meantime things have been improved. And then there was an issue with the undo not sure if related. I think in one of the junit tests you might still find a sleep to stabilize results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test junit test related things
Projects
None yet
Development

No branches or pull requests

2 participants