test discovery: report underlying problem when DiscoveredTestDataHolder fails to initialize several times in a row

GitOrigin-RevId: 8e4b6bd77368a176e31c1565599c2ec49873007f
This commit is contained in:
Vladislav Rassokhin
2023-08-23 10:42:48 +02:00
committed by intellij-monorepo-bot
parent d8ff36703b
commit 4194713f90

View File

@@ -2,6 +2,7 @@
package com.intellij.execution.testDiscovery.indices;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.diagnostic.Attachment;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Couple;
import com.intellij.openapi.util.Disposer;
@@ -71,6 +72,8 @@ public final class DiscoveredTestDataHolder {
int iterations = 0;
Throwable lastProblem;
while (true) {
++iterations;
@@ -104,10 +107,11 @@ public final class DiscoveredTestDataHolder {
PathKt.delete(basePath);
// try another time
lastProblem = throwable;
}
if (iterations >= 3) {
LOG.error("Unexpected circular initialization problem");
LOG.error("Unexpected repeatable initialization problem", new Attachment("last-reported-problem", lastProblem));
assert false;
}
}