Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ protected void setInfoText(String text) {
}

private static final int TIMEOUT = 5000;
// Generous bound for the one-time cold initialization of the lazy providers.
private static final int WARMUP_TIMEOUT = 60000;
// The lazy providers initialize once per JVM, so warm them only once.
private static boolean providersWarmedUp;
// As defined in QuickAccessDialog and in SearchField
private static final int MAXIMUM_NUMBER_OF_ELEMENTS = 60;
private static final Predicate<Shell> isQuickAccessShell = shell -> shell.getText()
Expand All @@ -109,6 +113,15 @@ public void setUp() throws Exception {
activeWorkbenchWindow = openTestWindow();
QuickAccessDialog warmupDialog = new QuickAccessDialog(activeWorkbenchWindow, null);
warmupDialog.open();
if (!providersWarmedUp) {
// Warm the lazy providers once with a real filter so their slow first query
// runs here, not inside a test's timed wait. An empty filter skips them.
Text warmupText = warmupDialog.getQuickAccessContents().getFilterText();
Table warmupTable = warmupDialog.getQuickAccessContents().getTable();
warmupText.setText("t");
DisplayHelper.waitForCondition(warmupText.getDisplay(), WARMUP_TIMEOUT, () -> warmupTable.getItemCount() > 0);
providersWarmedUp = true;
}
warmupDialog.close();
}

Expand Down
Loading