remove unused asyncIo.kt

GitOrigin-RevId: f4ad780ee27421e49262e8388532cc73873481eb
This commit is contained in:
Vladimir Krivosheev
2024-03-12 21:48:01 +00:00
committed by intellij-monorepo-bot
parent 093087f0c8
commit 824b6b45de
2 changed files with 2 additions and 23 deletions
@@ -1,15 +0,0 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.intellij.build.io
import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executors
import java.util.concurrent.ThreadPoolExecutor
private val ioExecutor = Executors.newCachedThreadPool() as ThreadPoolExecutor
internal fun runAsync(task: () -> Unit): CompletableFuture<Void> {
return CompletableFuture.runAsync(task, ioExecutor)
}
internal fun areAllIoTasksCompleted() = ioExecutor.activeCount == 0
@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("UsePropertyAccessSyntax")
package org.jetbrains.intellij.build.io
@@ -7,7 +7,6 @@ import com.intellij.openapi.util.SystemInfoRt
import kotlinx.coroutines.TimeoutCancellationException
import kotlinx.coroutines.runBlocking
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Assumptions.assumeTrue
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
@@ -33,18 +32,13 @@ class ProcessTest {
}
}
@AfterEach
fun allErrorOutputReadersAreDone() {
assertThat(areAllIoTasksCompleted()).isTrue()
}
private fun runShell(@Suppress("SameParameterValue") code: String, timeout: Duration) {
val script = Files.createTempFile("script", ".sh").toFile()
try {
script.writeText(code)
assertThat(script.setExecutable(true)).isTrue()
if (FileSystems.getDefault().supportedFileAttributeViews().contains("posix")) {
Files.setPosixFilePermissions(script.toPath(), PosixFilePermission.values().toSet())
Files.setPosixFilePermissions(script.toPath(), PosixFilePermission.entries.toSet())
}
runBlocking {
runProcess(args = listOf("sh", script.absolutePath), timeout = timeout)