Commit a0332c9
Bug 526917 - Allow all indexing to complete before query starts
getJavaElementMatches is doing a Java search - via
the OpenFromClipboardAction.
The SearchEngine tests which have some similar functionality all wait
for the index before trying to do the search. See most of the tests under
org.eclipse.jdt.core.tests.model.AbstractJavaSearchTests.
Code like one of these patterns is common:
1)
IndexManager indexManager = JavaModelManager.getIndexManager();
indexManager.indexAll(project.getProject());
waitUntilIndexesReady();
2)
JavaModelManager.getIndexManager().waitForIndex(false, null);
3)
refresh(project);
waitForAutoBuild();
waitUntilIndexesReady();
By adding the waitForIndex it is hoped the flaky test becomes stable.
Change-Id: Ic31ed2e5dc9d5541e49f455c87b04bdf7f1e1f7b
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/192113
Tested-by: Sarika Sinha <[email protected]>
Tested-by: JDT Bot <[email protected]>
Reviewed-by: Sarika Sinha <[email protected]>1 parent 947df2d commit a0332c9
File tree
1 file changed
+2
-0
lines changed- org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui
1 file changed
+2
-0
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| |||
0 commit comments