From bdada30bd9b7195e84dee5404d4ed9e37584644f Mon Sep 17 00:00:00 2001 From: Dmitrii Gridin Date: Mon, 20 Feb 2023 17:18:54 +0100 Subject: [PATCH] [tests] simplify tmp dir name in case of long name even non-Windows systems don't want to process very long names ^KT-55750 --- .../test/services/impl/TemporaryDirectoryManagerImpl.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/TemporaryDirectoryManagerImpl.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/TemporaryDirectoryManagerImpl.kt index 5827b5e2a7d..56ebcc70ed8 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/TemporaryDirectoryManagerImpl.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/TemporaryDirectoryManagerImpl.kt @@ -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('.')