From eea5ed82857d1bdbe0d3dad8f5c364d9c6c39cb6 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Fri, 26 Jan 2024 12:54:11 +0100 Subject: [PATCH] Disable VirtualLazyTreeViewerTest#testContains() on Mac #1183 The test case org.eclipse.jface.tests.viewers.VirtualLazyTreeViewerTest.testContains is randomly failing on Mac. Several other test cases accessing the data of items in a tree viewer with lazy content provider have been disabled on Mac due to some issue with the availability of the item data (bug 347491). Since there is no value in executing this test when the functionality is known to be broken and thus other related test cases are already disabled, this change disables the random failing test. Fixes https://github.com/eclipse-platform/eclipse.platform.ui/issues/1183 --- .../tests/viewers/VirtualLazyTreeViewerTest.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/viewers/VirtualLazyTreeViewerTest.java b/tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/viewers/VirtualLazyTreeViewerTest.java index 3fce9d42cfc..b7eec0ca65d 100644 --- a/tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/viewers/VirtualLazyTreeViewerTest.java +++ b/tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/viewers/VirtualLazyTreeViewerTest.java @@ -48,7 +48,8 @@ protected StructuredViewer createViewer(Composite parent) { @Override public void setUp() { super.setUp(); - // process events because the content provider uses an asyncExec to set the item count of the tree + // process events because the content provider uses an asyncExec to set the item + // count of the tree processEvents(); } @@ -240,4 +241,16 @@ public void testWorldChanged() { } super.testWorldChanged(); } + + @Override + public void testContains() { + if (disableTestsBug347491) { + return; + } + if (setDataCalls == 0) { + System.err.println("SWT.SetData is not received. Cancelled test " + testName.getMethodName()); + return; + } + super.testContains(); + } }