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

OpenFromClipboardTests still randomly fail #28

Closed
iloveeclipse opened this issue Apr 20, 2022 · 10 comments · Fixed by #358
Closed

OpenFromClipboardTests still randomly fail #28

iloveeclipse opened this issue Apr 20, 2022 · 10 comments · Fixed by #358
Assignees
Labels
test junit test related things

Comments

@iloveeclipse
Copy link
Member

I assume something like running other jobs (charset delta, autobuild) etc might confuse Java search.
Let disable autobuild, wait for charset delta job that might be running & see if that helps.

https://download.eclipse.org/eclipse/downloads/drops4/I20220419-1800/testresults/html/org.eclipse.jdt.debug.tests_ep424I-unit-cen64-gtk3-java18_linux.gtk.x86_64_18.html

junit.framework.AssertionFailedError: expected:<1> but was:<0>
at junit.framework.Assert.fail(Assert.java:57)
at junit.framework.Assert.failNotEquals(Assert.java:329)
at junit.framework.Assert.assertEquals(Assert.java:78)
at junit.framework.Assert.assertEquals(Assert.java:234)
at junit.framework.Assert.assertEquals(Assert.java:241)
at junit.framework.TestCase.assertEquals(TestCase.java:384)
at org.eclipse.jdt.debug.tests.ui.OpenFromClipboardTests.testStackElement_2(OpenFromClipboardTests.java:587)

https://download.eclipse.org/eclipse/downloads/drops4/I20220419-1800/testresults/html/org.eclipse.jdt.debug.tests_ep424I-unit-win32-java11_win32.win32.x86_64_11.html

junit.framework.AssertionFailedError: expected:<1> but was:<0>
at junit.framework.Assert.fail(Assert.java:57)
at junit.framework.Assert.failNotEquals(Assert.java:329)
at junit.framework.Assert.assertEquals(Assert.java:78)
at junit.framework.Assert.assertEquals(Assert.java:234)
at junit.framework.Assert.assertEquals(Assert.java:241)
at junit.framework.TestCase.assertEquals(TestCase.java:384)
at org.eclipse.jdt.debug.tests.ui.OpenFromClipboardTests.testMember_1(OpenFromClipboardTests.java:462)
@iloveeclipse iloveeclipse self-assigned this Apr 20, 2022
iloveeclipse added a commit to iloveeclipse/eclipse.jdt.debug that referenced this issue Apr 20, 2022
I assume something like running other jobs (charset delta, autobuild)
etc might confuse Java search. Let disable autobuild, wait for charset
delta job that might be running & see if that helps.

May be fixes issue
eclipse-jdt#28
iloveeclipse added a commit to iloveeclipse/eclipse.jdt.debug that referenced this issue Apr 20, 2022
I assume something like running other jobs (charset delta, autobuild)
etc might confuse Java search. Let disable autobuild, wait for charset
delta job that might be running & see if that helps.

May be fixes issue
eclipse-jdt#28
iloveeclipse added a commit that referenced this issue Apr 20, 2022
I assume something like running other jobs (charset delta, autobuild)
etc might confuse Java search. Let disable autobuild, wait for charset
delta job that might be running & see if that helps.

May be fixes issue
#28
@iloveeclipse
Copy link
Member Author

https://download.eclipse.org/eclipse/downloads/drops4/I20220420-1800/testResults.php is OK, few builds before we had fails in every build. But we also had one build with no fails, so let keep it open for a while and monitor.

@iloveeclipse
Copy link
Member Author

iloveeclipse commented Apr 22, 2022

Failed again: https://download.eclipse.org/eclipse/downloads/drops4/I20220421-1910/testresults/html/org.eclipse.jdt.debug.tests_ep424I-unit-mac64-java17_macosx.cocoa.x86_64_17.html

expected:<1> but was:<0>

junit.framework.AssertionFailedError: expected:<1> but was:<0>
at junit.framework.Assert.fail(Assert.java:57)
at junit.framework.Assert.failNotEquals(Assert.java:329)
at junit.framework.Assert.assertEquals(Assert.java:78)
at junit.framework.Assert.assertEquals(Assert.java:234)
at junit.framework.Assert.assertEquals(Assert.java:241)
at junit.framework.TestCase.assertEquals(TestCase.java:384)
at org.eclipse.jdt.debug.tests.ui.OpenFromClipboardTests.testMember_3(OpenFromClipboardTests.java:491)
junit.framework.AssertionFailedError: expected:<1> but was:<0>
at junit.framework.Assert.fail(Assert.java:57)
at junit.framework.Assert.failNotEquals(Assert.java:329)
at junit.framework.Assert.assertEquals(Assert.java:78)
at junit.framework.Assert.assertEquals(Assert.java:234)
at junit.framework.Assert.assertEquals(Assert.java:241)
at junit.framework.TestCase.assertEquals(TestCase.java:384)
at org.eclipse.jdt.debug.tests.ui.OpenFromClipboardTests.testMethod_6(OpenFromClipboardTests.java:390)

@fedejeanne
Copy link
Contributor

org.eclipse.jdt.debug.tests.ui.OpenFromClipboardTests.testMethod_6 failed again in this check of #277

@fedejeanne
Copy link
Contributor

I created a PR to help identify the underlying cause of the failures --> #279 .

I do have a question though, perhaps someone has a hint. Does anyone know why the call to fAccessor.invoke("getJavaElementMatches", ... ) in the private method OpenFromClipboardTests::getJavaElementMatches(String) needs to run through the Display class? I mean why call:

Display.getDefault().syncExec(new Runnable() {
			@Override
			public void run() {
				fAccessor.invoke("getJavaElementMatches", new Class[] { String.class, List.class }, new Object[] { textData, matches });
			}
		});

... when I can simply call:

fAccessor.invoke("getJavaElementMatches", new Class[] { String.class, List.class }, new Object[] { textData, matches });

?

Is it just to make sure that all other UI-blocking tasks like indexing and encoding are done before calling the Runnable? If yes, hasn't that already been achieved by calling OpenFromClipboardTests::waitForEncodingRelatedJobs() ?

@jukzi jukzi added the test junit test related things label Dec 1, 2023
jukzi pushed a commit to jukzi/eclipse.jdt.debug that referenced this issue Dec 4, 2023
Makes TestAgainException protected,
let OpenFromClipboardTests extend AbstractDebugTest to actually use the
retry logic

eclipse-jdt#28
jukzi pushed a commit to jukzi/eclipse.jdt.debug that referenced this issue Dec 4, 2023
Makes TestAgainException protected,
let OpenFromClipboardTests extend AbstractDebugTest to actually use the
retry logic

eclipse-jdt#28
@jukzi jukzi linked a pull request Dec 4, 2023 that will close this issue
jukzi pushed a commit to jukzi/eclipse.jdt.debug that referenced this issue Dec 4, 2023
OpenFromClipboardTests can not use TestAgainException because it does
not extend AbstractDebugTest to actually use the
retry logic.
Use a junit4 RetryRule instead.

eclipse-jdt#28
@jukzi
Copy link
Contributor

jukzi commented Dec 4, 2023

needs to run through the Display class?

most time you will find such information in the commit history:
image

https://bugs.eclipse.org/bugs/show_bug.cgi?id=335284#c2

jukzi pushed a commit to jukzi/eclipse.jdt.debug that referenced this issue Dec 4, 2023
OpenFromClipboardTests can not use TestAgainException because it does
not extend AbstractDebugTest to actually use the
retry logic also a retry does not in this test.

wait for ResourcesPlugin.FAMILY_AUTO_REFRESH

eclipse-jdt#28
jukzi pushed a commit to jukzi/eclipse.jdt.debug that referenced this issue Dec 4, 2023
OpenFromClipboardTests can not use TestAgainException because it does
not extend AbstractDebugTest to actually use the
retry logic also a retry does not in this test.

wait for ResourcesPlugin.FAMILY_AUTO_REFRESH

eclipse-jdt#28
jukzi pushed a commit to jukzi/eclipse.jdt.debug that referenced this issue Dec 4, 2023
…dt#28

OpenFromClipboardTests can not use TestAgainException because it does
not extend AbstractDebugTest to actually use the
retry logic also a retry does not in this test.

eclipse-jdt#28
jukzi pushed a commit that referenced this issue Dec 4, 2023
OpenFromClipboardTests can not use TestAgainException because it does
not extend AbstractDebugTest to actually use the
retry logic also a retry does not in this test.

#28
@jukzi jukzi linked a pull request Dec 4, 2023 that will close this issue
@jukzi
Copy link
Contributor

jukzi commented Dec 4, 2023

should be fixed with #358

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
6 participants