mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
logging around daemon execution in tests
to hopefully help a bit the next time it's canceled for a mysterious reason
This commit is contained in:
+1
@@ -308,6 +308,7 @@ class RefCountHolder {
|
||||
ProgressIndicator result;
|
||||
if (myState.compareAndSet(EMPTY, indicator)) {
|
||||
if (!file.getTextRange().equals(dirtyScope)) {
|
||||
log(" RefCountHolder: invalid scope " + dirtyScope);
|
||||
// empty holder needs filling before it can be used, so restart daemon to re-analyze the whole file
|
||||
myState.set(EMPTY);
|
||||
return false;
|
||||
|
||||
@@ -68,6 +68,15 @@ public class ProgressWrapper extends AbstractProgressIndicatorBase implements Wr
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected Throwable getCancellationTrace() {
|
||||
if (myOriginal instanceof AbstractProgressIndicatorBase) {
|
||||
return ((AbstractProgressIndicatorBase)myOriginal).getCancellationTrace();
|
||||
}
|
||||
return super.getCancellationTrace();
|
||||
}
|
||||
|
||||
private boolean isCanceledRaw() { return super.isCanceled(); }
|
||||
private void checkCanceledRaw() { super.checkCanceled(); }
|
||||
|
||||
|
||||
+3
-3
@@ -207,7 +207,8 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
DaemonCodeAnalyzerSettings settings = DaemonCodeAnalyzerSettings.getInstance();
|
||||
|
||||
ProcessCanceledException exception = null;
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
int retries = 1000;
|
||||
for (int i = 0; i < retries; i++) {
|
||||
int oldDelay = settings.AUTOREPARSE_DELAY;
|
||||
try {
|
||||
settings.AUTOREPARSE_DELAY = 0;
|
||||
@@ -231,8 +232,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
settings.AUTOREPARSE_DELAY = oldDelay;
|
||||
}
|
||||
}
|
||||
// unable to highlight after 100 retries
|
||||
throw exception;
|
||||
throw new AssertionError("Unable to highlight after " + retries + " retries", exception);
|
||||
}
|
||||
|
||||
public static void ensureIndexesUpToDate(@NotNull Project project) {
|
||||
|
||||
Reference in New Issue
Block a user