t

    thanksforallthefish

    3 years ago
    I am having a hard time upgrading from
    3.1
    . Given this production class
    class App {
    	companion object {
    		val threadLocal: ThreadLocal<String> = ThreadLocal()
    	}
    
    	val greeting: String
    		get() {
    			return threadLocal.get()
    		}
    }
    this test is successful in 3.1m but fails in
    3.2
    and
    3.3
    import io.kotlintest.Description
    import io.kotlintest.Spec
    import io.kotlintest.shouldBe
    import io.kotlintest.specs.StringSpec
    
    class AppIntegrationTest : StringSpec() {
    	override fun beforeSpec(description: Description, spec: Spec) {
    		App.threadLocal.set("test")
    	}
    
    	init {
    		"greetings" {
    			App().greeting shouldBe "test"
    		}
    	}
    }
    from what I was able to grasp, it seems
    3.1
    was running tests in
    kotlintest
    thread, while
    3.2+
    is using a thread pool. can I configure thread pool for kotlintest?
    gradle file
    plugins {
    	val kotlinVersion = "1.3.21"
    	kotlin("jvm") version kotlinVersion
    }
    
    repositories {
    	jcenter()
    }
    
    dependencies {
    	implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    
    	testImplementation("io.kotlintest:kotlintest-runner-junit5:3.1+")
    }