-
Notifications
You must be signed in to change notification settings - Fork 143
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
Several tests in "org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text" are flapping #106
Comments
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: final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout (new GridLayout (1, true));
Text text = new Text(shell, 0);
System.out.format("%X = handle%n", text.handle);
shell.pack();
shell.open();
while (display.readAndDispatch()) {};
for (int i = 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 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. |
https://github.com/eclipse-platform/eclipse.platform.swt/actions/runs/7674714373/job/20919789301
|
Also failed in this run of #1265 expected:<[00000]> but was:<[]>
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:343)
... |
The test fails from one build to the other without any SWT code changes.
The text was updated successfully, but these errors were encountered: