Skip to content

Commit 4f9ee7a

Browse files
committed
Wait for the expected item count in QuickAccessDialogTest.testShowAll
testShowAll toggled "show all" (and back) but waited only for the table item count to differ from the previous count, while asserting a direction: more items when showing all, fewer when limiting again. The visible row count can shift by one as scroll bars appear and disappear during layout, so the "differs" wait could return on that incidental change and capture a count that was not yet the expanded (or limited) one, failing the assertion intermittently on macOS. Wait for the actual asserted condition instead (count greater than the limited count when showing all, less than the full count when limiting), so an incidental one-off change no longer ends the wait early.
1 parent 675a1a3 commit 4f9ee7a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/quickaccess/QuickAccessDialogTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,14 @@ public void testShowAll() throws Exception {
243243
.getService(IHandlerService.class);
244244
// Run the handler to turn on show all
245245
handlerService.executeCommand("org.eclipse.ui.window.quickAccess", null); //$NON-NLS-1$
246-
processEventsUntil(() -> table.getItemCount() != defaultCount, TIMEOUT);
246+
processEventsUntil(() -> table.getItemCount() > defaultCount, TIMEOUT);
247247
final int allCount = table.getItemCount();
248248
assertTrue(allCount > defaultCount, "Turning on show all should display more items");
249249
assertEquals(oldFirstItemText, table.getItem(0).getText(1), "Turning on show all should not change the top item");
250250

251251
// Run the handler to turn off show all
252252
handlerService.executeCommand("org.eclipse.ui.window.quickAccess", null); //$NON-NLS-1$
253-
processEventsUntil(() -> table.getItemCount() != allCount, TIMEOUT);
253+
processEventsUntil(() -> table.getItemCount() < allCount, TIMEOUT);
254254
// Note: The table count may one off from the old count because of shell resizing (scroll bars being added then removed)
255255
assertTrue(table.getItemCount() < allCount, "Turning off show all should limit items shown");
256256
assertEquals(oldFirstItemText, table.getItem(0).getText(1), "Turning off show all should not change the top item");

0 commit comments

Comments
 (0)