PY-84289 Compute getStringBasedType with doPreventingRecursion to avoid repeating calculations

GitOrigin-RevId: a548f05bea971f6b3e3acdb1f1bc7898d3411d5e
This commit is contained in:
evgeny.bovykin
2025-09-29 13:38:19 +00:00
committed by intellij-monorepo-bot
parent 2c1299f1c6
commit 61b55f5a71
4 changed files with 53 additions and 2 deletions
@@ -3156,6 +3156,19 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
doMultiFileTest();
}
// PY-84289
public void testExponentialAnalysisTimeWhenMapLookupKeyEqualsVariableName() {
long before = System.currentTimeMillis();
doMultiFileTest("main.py");
long after = System.currentTimeMillis();
long diff = after - before;
// junit3 doesn't support timeouts out of the box
if (diff > 5000) {
fail("Took too long to analyze main.py: " + diff + " ms");
}
}
@NotNull
@Override
protected Class<? extends PyInspection> getInspectionClass() {