You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Several tests in "org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text" are flapping #106
The failure is chance based, with around 1% chance.
It's easy to reproduce by running this code:
finalDisplaydisplay = newDisplay();
finalShellshell = newShell(display);
shell.setLayout (newGridLayout (1, true));
Texttext = newText(shell, 0);
System.out.format("%X = handle%n", text.handle);
shell.pack();
shell.open();
while (display.readAndDispatch()) {};
for (inti = 0; i < 10000; i++) {
text.setText("01234567890");
text.setSelection(2, 5);
text.cut();
if (!text.getText().equals("01567890")) {
System.out.println("Error!");
}
}
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
I have debugged, the problem is that OpenClipboard() fails inside WINAPI handler for messages like WM_COPY or WM_CUT. Can be seen with WinDBG breakpoint: bp win32u!NtUserOpenClipboard+0x14 ".if (@rax == 1) {g}".
I'm not exactly sure what causes the failure. It doesn't make sense that some other app repeatedly claims ownership of clipboard, but maybe that is indeed the case. Maybe when SWT copies something to clipboard, some other app checks that, and if SWT tries to copy again while app is checking, it fails. Getting a definitive answer would require kernel debugging, and I don't think the Issue is important enough to spend time on that.
org.junit.ComparisonFailure: expected:<[00000]> but was:<[]>
at org.junit.Assert.assertEquals(Assert.java:117)
at org.junit.Assert.assertEquals(Assert.java:146)
at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text.test_copy(Test_org_eclipse_swt_widgets_Text.java:324)
changed the title [-]test_cut (org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text) is flapping[/-][+]Several tests in "org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text" are flapping[/+]on Jun 18, 2024
Activity
SyntevoAlex commentedon Jul 4, 2023
I have investigated that.
All clipboard-related tests can fail, I myself seen these:
The failure is chance based, with around 1% chance.
It's easy to reproduce by running this code:
I have debugged, the problem is that
OpenClipboard()fails inside WINAPI handler for messages likeWM_COPYorWM_CUT. Can be seen with WinDBG breakpoint:bp win32u!NtUserOpenClipboard+0x14 ".if (@rax == 1) {g}".I'm not exactly sure what causes the failure. It doesn't make sense that some other app repeatedly claims ownership of clipboard, but maybe that is indeed the case. Maybe when SWT copies something to clipboard, some other app checks that, and if SWT tries to copy again while app is checking, it fails. Getting a definitive answer would require kernel debugging, and I don't think the Issue is important enough to spend time on that.
basilevs commentedon Jan 27, 2024
https://github.com/eclipse-platform/eclipse.platform.swt/actions/runs/7674714373/job/20919789301
fedejeanne commentedon Jun 18, 2024
Also failed in this run of #1265
[-]test_cut (org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text) is flapping[/-][+]Several tests in "org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text" are flapping[/+]deepika-u commentedon Jan 9, 2025
Can this also be closed?
As i see the tests pass now
From -> https://download.eclipse.org/eclipse/downloads/drops4/I20250108-1800/testresults/xml/org.eclipse.swt.tests_ep435I-unit-win32-x86_64-java21_win32.win32.x86_64_21.xml
fedejeanne commentedon Jan 13, 2025
The problem seems to be there still:
Or do you know of any fix @deepika-u ?
To reproduce
Let the test class run hundreds of times by making it parameterized
Improve stability of Text cut/copy/paste tests on Windows
Improve stability of Text cut/copy/paste tests on Windows
Improve stability of Text cut/copy/paste tests on Windows
Improve stability of Text cut/copy/paste tests on Windows
Improve stability of Text cut/copy/paste tests on Windows