Kweku
04/08/2021, 11:56 PMArb.long
is fine but using it in checkAll
for example or doing something like arb.long.take(1)
results in the exception
I'm using property testing but not the framework.sam
04/09/2021, 12:04 AMKweku
04/09/2021, 2:07 PMsam
04/09/2021, 2:40 PMKweku
04/09/2021, 3:33 PMKweku
04/09/2021, 3:38 PMkotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.random.XorWowRandom@2c52d248
kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.random.XorWowRandom@2c52d248
at kotlin.Throwable#<init>(/Users/teamcity1/teamcity_work/11ac87a349af04d5/runtime/src/main/kotlin/kotlin/Throwable.kt:23)
at kotlin.Exception#<init>(/Users/teamcity1/teamcity_work/11ac87a349af04d5/runtime/src/main/kotlin/kotlin/Exceptions.kt:23)
at kotlin.RuntimeException#<init>(/Users/teamcity1/teamcity_work/11ac87a349af04d5/runtime/src/main/kotlin/kotlin/Exceptions.kt:34)
at kotlin.native.concurrent.InvalidMutabilityException#<init>(/Users/teamcity1/teamcity_work/11ac87a349af04d5/runtime/src/main/kotlin/kotlin/native/concurrent/Freezing.kt:22)
at <global>.ThrowInvalidMutabilityException(/Users/teamcity1/teamcity_work/11ac87a349af04d5/runtime/src/main/kotlin/kotlin/native/concurrent/Internal.kt:93)
at <global>.MutationCheck(Unknown Source)
at kotlin.random.XorWowRandom.<set-x>#internal(/Users/teamcity1/teamcity_work/11ac87a349af04d5/backend.native/build/stdlib/kotlin/random/XorWowRandom.kt:20)
at kotlin.random.XorWowRandom#nextInt(/Users/teamcity1/teamcity_work/11ac87a349af04d5/backend.native/build/stdlib/kotlin/random/XorWowRandom.kt:43)
at kotlin.random.Random#nextLong(/Users/teamcity1/teamcity_work/11ac87a349af04d5/backend.native/build/stdlib/kotlin/random/Random.kt:95)
at kotlin.random#nextLong@kotlin.random.Random(/Users/teamcity1/teamcity_work/11ac87a349af04d5/backend.native/build/stdlib/kotlin/random/Random.kt:358)
at io.kotest.property.arbitrary.long$lambda-0#internal(/Users/runner/work/kotest/kotest/kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/longs.kt:22)
at io.kotest.property.arbitrary.$long$lambda-0$FUNCTION_REFERENCE$107.invoke#internal(/Users/runner/work/kotest/kotest/kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/longs.kt:22)
at io.kotest.property.arbitrary.$long$lambda-0$FUNCTION_REFERENCE$107.$<bridge-BNNN>invoke(/Users/runner/work/kotest/kotest/kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/longs.kt:22)
at io.kotest.property.arbitrary.object-8.values$lambda-0#internal(/Users/runner/work/kotest/kotest/kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/builders.kt:30)
at io.kotest.property.arbitrary.object-8.$values$lambda-0$FUNCTION_REFERENCE$42.invoke#internal(/Users/runner/work/kotest/kotest/kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/builders.kt:30)
at kotlin.sequences.GeneratorSequence.object-1.calcNext#internal(/Users/teamcity1/teamcity_work/11ac87a349af04d5/backend.native/build/stdlib/kotlin/collections/Sequences.kt:591)
at kotlin.sequences.GeneratorSequence.object-1.hasNext#internal(/Users/teamcity1/teamcity_work/11ac87a349af04d5/backend.native/build/stdlib/kotlin/collections/Sequences.kt:609)
at io.kotest.property.Arb#samples(/Users/runner/work/kotest/kotest/kotest-property/src/commonMain/kotlin/io/kotest/property/Gen.kt:85)
at io.kotest.property.arbitrary#take@io.kotest.property.Arb<0:0>(/Users/runner/work/kotest/kotest/kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/arbs.kt:10)
at io.kotest.property.arbitrary#take$default@io.kotest.property.Arb<0:0>
sam
04/09/2021, 3:42 PMKweku
04/09/2021, 3:59 PMArb.long().take(1, RandomSource(Random(1),1))
both in a normal test and a runblocking test
but Arb.long().take()
causes an exception
My original usage was just using arbs in checkAll which causes exceptions on IOS. I started calling take to try and work out where the issue wassam
04/09/2021, 4:11 PMsam
04/09/2021, 4:11 PMsam
04/09/2021, 4:11 PMsam
04/09/2021, 4:11 PMKweku
04/09/2021, 4:14 PMPropTestConfig
with a seed specifiedsam
04/09/2021, 4:20 PMsam
04/09/2021, 4:52 PMKweku
04/09/2021, 6:33 PMsam
04/09/2021, 6:47 PMsam
04/09/2021, 6:47 PM