Hi I wonder where it is possible to retrieve the A...
# kotest
i
Hi I wonder where it is possible to retrieve the Arb.seed for porperty-tests. I am in Kotest : 4.3.1. And depend on
io.kotest:kotest-property
. I have some Tests that fail every now and then and I wanted to save those edgecases, to ensure that their fixed
s
The seed is outputted to the console when an error fails, is that what you need?
i
In most cases I get a report like this:
Copy code
java.lang.AssertionError: Property failed after 1 attempts

Repeat this test by using seed 6157672104206447713
but in the application I am running the prop tests against I sometimes run into test error’s, where this is not supplied
s
Oh, what do you mean by test error ?
i
A failed test, sorry if that was poorly expressed
s
So one with an exception other than assertion error, is what that you mean ?
like do you have a simple example
i
yes correct
s
so
Copy code
test("foo") {
  checkAll<String> { a -> error(boom") }
}
I can't duplicate it
Copy code
test("errored test should print seed") {
   checkAll<Int, Int> { _, _ -> error("boom") }
}
i
Yes, in my case its something like:
Copy code
test("foo") {
  forAll(Arb.list(Arb.domainType) { records ->
saveElementsToDB(records)
  record == collectRecordsfromDB()
}
}
in some cases one or two elemts are missing
s
Copy code
Property failed after 1 attempts
java.lang.AssertionError: Property failed after 1 attempts

Repeat this test by using seed -3454921614817430845
i
Can I check in with you after this weekend if I can create a small reproducible example. Thanks for your help
s
yes of course, I will continue to have a play myself
i
🙌🏽
Hi Sam, I was not able to reproduce it. Hopefully along the road I can come up with a small reproducible example. So far I’ve been just randomly testing seeds until one fails consistently 😅