question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BehaviorSpec run parallel?

See original GitHub issue

When I execute this BehaviorSpec, the upper when block always fails (even when I swap those two). the upper block assignment is always overridden by the latter. Is this an issue or I just misunderstand spec flow?

given("user) {
val user = User()

  `when`("set valid email") {
    user.email = VALID_EMAIL
    
    then("should get correct email") {
      user.email shouldBe VALID_EMAIL
    }
  }
 
  `when`("set null email") {
    user.email = null
      
    then("should get null email") {
      user.email shouldBe null
    }
  }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sksamuelcommented, Mar 24, 2018

This is fixed in 3.0.0 RC1. If you have the time, please give it a try. There are some breaking changes that should be aware of by reading the changelog here: https://github.com/kotlintest/kotlintest/blob/master/CHANGELOG.md

1reaction
sksamuelcommented, Mar 21, 2018

The issue is, the when block has to be executed in order to discover the then block nested inside. However, this means the side effects (setting user.email) overwrite each other.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project Level Config - Kotest
You can ask Kotest to run specs in parallel to take advantage of modern cpus with several cores by setting the parallelism level...
Read more >
Run tests in single Spec in parallel ini kotest - Stack Overflow
I'm using kotest for my e2e API testing. All tests are independent and should have no problem running them in parallel. But with...
Read more >
Kotest Pro Tips - ProAndroidDev
Set the system property kotest.parallelism to a value higher than 1, and separate test files will be executed inside a thread pool.
Read more >
Lifecycle behaviour in combination with BehaviorSpec #776
I prefer BDD style which is why I'm using BehaviorSpec. ... DispatchedTask.run(Dispatched.kt:233) at java.util.concurrent.
Read more >
How to use behaviorSpec method of io.kotest.core.spec.style ...
Accelerate Your Automation Test Cycles With LambdaTest. Leverage LambdaTest's cloud-based platform to execute your automation tests in parallel and trim down ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found