-
Notifications
You must be signed in to change notification settings - Fork 138
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
Multiple tests failing in Test_org_eclipse_swt_browser_Browser #1564
Comments
"More" is a comparison. Did you mean "Multiple" which is a numeric? Is the failure always reproduceable or random? |
I originally meant "more" because I wanted to mention the other tests that are failing (for which there is already an issue) but I changed my mind to avoid confusion. I changed the title now, thank you for the pointer. The tests fail very consistently when I run them locally. I am not sure about the failures in the pipelines though, I've only seen them failing in my own PRs. |
I can reproduce the failures locally on Ubuntu 24.04.1, Webkit 2.46.1. Tests fail with both X11 and Wayland. When I use the WebKit browser inside Eclipse and navigate to an HTML file that contains the same code as passed to the browser in the test, a child window pops up as expected. |
In tonight's I-build these tests now fail for all java versions 17,21 and 23. In the last night's it only failed for 17: I cannot tell if this is related to switching to Ubunut based images for Linux (eclipse-platform/eclipse.platform.releng.aggregator#2522) or if this is all just coincidence. |
I believe it's related (e.g. different webkitgtk version) but failing constantly is better than randomly. |
I can now confirm that an update of webkit introduced these test failures. I just downgraded from version 2.46.1 to 2.44.0 and the tests run fine again. More precisely, I downgraded the following libraries on an Ubuntu 24.04 system (target version: 2.44.0-2, original version: 2.46.1-0ubuntu0.24.04.1):
|
I can't notice anything in webkitgtk news file but it doesn't seem to contain changes in webkit engine itself but only changes to the "bindings" aka it's still to be figured where to find the changes in the engine itself. |
Indeed. I have not yet understood where the event flow stops. It does not seem to be missing JavaScript execution (as I indicated first), but rather with subsequent event processing. I also found a warning being logged with the current WebKit version that may direct to the problem (the "child" browser not being instantiated correctly):
I have extracted one of the test cases into a standalone snippet (but the essence of the snippet is the same for all failing tests, so the root cause should be the same): public class OpenChildBrowser {
public static void main(String[] args) {
Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
final Browser browser = new Browser(shell, SWT.NONE);
Shell childShell = new Shell(shell, SWT.None);
childShell.setText("Child shell");
childShell.setLayout(new FillLayout());
final Browser browserChild = new Browser(childShell, SWT.NONE);
browser.addOpenWindowListener(event -> {
System.out.println("Open Window Listener");
event.browser = browserChild;
});
browserChild.addVisibilityWindowListener(showAdapter(event -> {
System.out.println("Open shell");
childShell.open();
browserChild.setText("Child Browser");
}));
shell.open();
browser.setText("""
<html>
<script type='text/javascript'>
var newWin = window.open('about:blank');
</script>
<body>
This test uses javascript to open a new window.
</body>
</html>
""");
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
} The flow stops between processing the window opening event of the "main" browser (setting the This is the log output of above snippet for WebKit 2.44.0 (the second line is an added println to
This is the log output of above snippet for WebKit 2.46.1:
Unfortunately, I can currently not put more effort into this. Whoever wants to take over may find these commands useful (if on Ubuntu 24.04) to switch between the two WebKit versions for testing purposes: Switch to current WebKit (2.46.1):
Switch to previous WebKit (2.44.0):
|
I was also looking at this and debugging side to side WebKit 2.32.4 (Ubuntu 18.04.5 LTS) vs WebKit 2.46.1 (Ubuntu 24.04 LTS). All I can tell is that for 2.46.1 some
Looking at the documentation of
... which wasn't necessary before. But then again, this is just a guess and it relies on the fact that the default value of the If someone knows how to check if older versions of webkit were in fact using That's as far as I could get. Hopefully someone with more knowledge can help understand and solve this issue. |
These 3 tests fail on Linux. I noticed in this run of #1496 and I was also able to reproduce it locally using WSL2:
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser.test_OpenWindowListener_open_ChildPopup()
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser.test_OpenWindow_Progress_Listener_ValidateEventOrder()
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser.test_VisibilityWindowListener_eventSize()
It seems to be some issue with JavaScript (just my guess), here are some screenshots (WSL2):
All 3 tests timed out.
The text was updated successfully, but these errors were encountered: