After upgrading to Kotest 5.0.0 (from 4.6.3) I'm s...
# kotest
s
After upgrading to Kotest 5.0.0 (from 4.6.3) I'm seeing some unit test fail that use Wiremock to start / stop a server in
beforeSpec {}
/
afterSpec {}
, see https://dev.azure.com/oss-review-toolkit/ort/_build/results?buildId=6317&view=ms.vs[…]ld-test-results-tab&runId=38928&resultId=100025&paneView=debug. Is anyone else experiencing problems with Kotest 5 & Wiremock?
The issue apparently cannot be reproduced when just running the single test on its own; it only appears when also running other tests that use Wiremock.
To reproduce, checkout https://github.com/oss-review-toolkit/ort/tree/kotest-upgrade and run
./gradlew :advisor:test
.
b
Smells like some leaking race condition.
Or maybe your mocks are not cleaned up from other tests. Are you using shared instance of wiremock for all your tests?
s
Each spec uses its own
WireMockServer
for all its contained tests.
e
Is it always failing with connecting to port 8080? Your wiremock server says it should use a dynamic port, so not sure where the 8080 comes from?
s
Good catch about the 8080, it actually should be a random port...
Looks like calling
configureFor()
in
beforeTest()
instead of in
beforeSpec()
solved it...