Skip to content

Commit

Permalink
fix: server tests on jdk17
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Jan 31, 2025
1 parent b36b647 commit d6a8801
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
4 changes: 0 additions & 4 deletions pkl-server/pkl-server.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,3 @@ testNative {
}
}

tasks.withType(Test::class).configureEach {
// Disable multi-JDK testing for pkl-server.
enabled = !name.lowercase().contains("jdk")
}
18 changes: 12 additions & 6 deletions pkl-server/src/test/kotlin/org/pkl/server/AbstractServerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import kotlin.io.path.outputStream
import kotlin.io.path.writeText
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.io.TempDir
Expand All @@ -38,13 +39,18 @@ abstract class AbstractServerTest {
companion object {
/** Set to `true` to bypass messagepack serialization when running [JvmServerTest]. */
internal const val USE_DIRECT_TRANSPORT = false
lateinit var executor: ExecutorService

val executor: ExecutorService =
if (USE_DIRECT_TRANSPORT) {
createDirectExecutor()
} else {
Executors.newCachedThreadPool()
}
@BeforeAll
@JvmStatic
fun beforeAll() {
executor =
if (USE_DIRECT_TRANSPORT) {
createDirectExecutor()
} else {
Executors.newCachedThreadPool()
}
}

@AfterAll
@JvmStatic
Expand Down

0 comments on commit d6a8801

Please sign in to comment.