Skip to content

Commit de04da0

Browse files
author
luigi
committed
fix
1 parent 61ce2f8 commit de04da0

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

tests/codegen/service-codegen-tests/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ kotlin {
3838
compilerOptions {
3939
freeCompilerArgs.addAll(
4040
"-opt-in=kotlin.io.path.ExperimentalPathApi",
41-
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi"
41+
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
4242
)
4343
}
4444
}

tests/codegen/service-codegen-tests/src/test/kotlin/com/test/ServiceGeneratorTest.kt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ internal fun ServiceGeneratorTest.cleanupService(proc: Process) {
449449
}
450450

451451
try {
452-
killProcess(proc)
452+
proc.destroy()
453453
val exited = proc.waitFor(gracefulWindow, TimeUnit.MILLISECONDS)
454454

455455
if (!exited) {
@@ -469,14 +469,6 @@ internal fun ServiceGeneratorTest.cleanupService(proc: Process) {
469469

470470
private fun isWindows() = System.getProperty("os.name").lowercase().contains("windows")
471471

472-
private fun killProcess(proc: Process) {
473-
if (isWindows()) {
474-
Runtime.getRuntime().exec("taskkill /F /T /PID ${proc.pid()}")
475-
} else {
476-
proc.destroy()
477-
}
478-
}
479-
480472
internal fun waitForPort(port: Int, timeoutSec: Long = 180): Boolean {
481473
val deadline = System.currentTimeMillis() + TimeUnit.SECONDS.toNanos(timeoutSec)
482474
while (System.currentTimeMillis() < deadline) {

0 commit comments

Comments
 (0)