[tests] simplify tmp dir name in case of long name

even non-Windows systems don't want to process very long names

^KT-55750
This commit is contained in:
Dmitrii Gridin
2023-02-20 17:18:54 +01:00
parent b3cb47e8a1
commit bdada30bd9
@@ -19,7 +19,9 @@ class TemporaryDirectoryManagerImpl(testServices: TestServices) : TemporaryDirec
val testInfo = testServices.testInfo
val className = testInfo.className
val methodName = testInfo.methodName
if (!onWindows) return@run KtTestUtil.tmpDirForTest(className, methodName)
if (!onWindows && className.length + methodName.length < 255) {
return@run KtTestUtil.tmpDirForTest(className, methodName)
}
// This code will simplify directory name for windows. This is needed because there can occur errors due to long name
val lastDot = className.lastIndexOf('.')