mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
BaseUITestCase.waitForIndexer() intermittently throws exception
This commit is contained in:
parent
ab22bbda2d
commit
82a89c35ed
1 changed files with 16 additions and 11 deletions
|
@ -125,20 +125,25 @@ public class BaseUITestCase extends BaseTestCase {
|
||||||
|
|
||||||
if (CCorePlugin.getIndexManager().isIndexerSetupPostponed(CoreModel.getDefault().create(file.getProject())))
|
if (CCorePlugin.getIndexManager().isIndexerSetupPostponed(CoreModel.getDefault().create(file.getProject())))
|
||||||
continue;
|
continue;
|
||||||
index.acquireReadLock();
|
|
||||||
try {
|
try {
|
||||||
IIndexFile[] indexFiles= index.getFiles(IndexLocationFactory.getWorkspaceIFL(file));
|
index.acquireReadLock();
|
||||||
for (IIndexFile indexFile : indexFiles) {
|
try {
|
||||||
if (indexFile != null && indexFile.getTimestamp() >= file.getLocalTimeStamp()) {
|
IIndexFile[] indexFiles= index.getFiles(IndexLocationFactory.getWorkspaceIFL(file));
|
||||||
return;
|
for (IIndexFile indexFile : indexFiles) {
|
||||||
|
if (indexFile != null && indexFile.getTimestamp() >= file.getLocalTimeStamp()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
index.releaseReadLock();
|
||||||
|
int time= (int) (endTime - System.currentTimeMillis());
|
||||||
|
if (time > 0) {
|
||||||
|
CCorePlugin.getIndexManager().joinIndexer(time, npm());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
}
|
||||||
index.releaseReadLock();
|
catch (InterruptedException e) {
|
||||||
int time= (int) (endTime - System.currentTimeMillis());
|
// index.acquireReadLock() can be interrupted
|
||||||
if (time > 0) {
|
|
||||||
CCorePlugin.getIndexManager().joinIndexer(time, npm());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new Exception("Indexer did not complete in time!");
|
throw new Exception("Indexer did not complete in time!");
|
||||||
|
|
Loading…
Add table
Reference in a new issue