Skip to content

Commit 69750d3

Browse files
committed
fix: server tests on jdk17
Signed-off-by: Sam Gammon <sam@elide.dev>
1 parent a41d5e8 commit 69750d3

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

pkl-server/pkl-server.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,3 @@ testNative {
108108
}
109109
}
110110

111-
tasks.withType(Test::class).configureEach {
112-
// Disable multi-JDK testing for pkl-server.
113-
enabled = !name.lowercase().contains("jdk")
114-
}

pkl-server/src/test/kotlin/org/pkl/server/AbstractServerTest.kt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import kotlin.io.path.outputStream
2525
import kotlin.io.path.writeText
2626
import org.assertj.core.api.Assertions.assertThat
2727
import org.junit.jupiter.api.AfterAll
28+
import org.junit.jupiter.api.BeforeAll
2829
import org.junit.jupiter.api.Disabled
2930
import org.junit.jupiter.api.Test
3031
import org.junit.jupiter.api.io.TempDir
@@ -38,13 +39,18 @@ abstract class AbstractServerTest {
3839
companion object {
3940
/** Set to `true` to bypass messagepack serialization when running [JvmServerTest]. */
4041
internal const val USE_DIRECT_TRANSPORT = false
42+
lateinit var executor: ExecutorService
4143

42-
val executor: ExecutorService =
43-
if (USE_DIRECT_TRANSPORT) {
44-
createDirectExecutor()
45-
} else {
46-
Executors.newCachedThreadPool()
47-
}
44+
@BeforeAll
45+
@JvmStatic
46+
fun beforeAll() {
47+
executor =
48+
if (USE_DIRECT_TRANSPORT) {
49+
createDirectExecutor()
50+
} else {
51+
Executors.newCachedThreadPool()
52+
}
53+
}
4854

4955
@AfterAll
5056
@JvmStatic

0 commit comments

Comments
 (0)