title: Kotlin withTimeout does not work in Intellij gradle project
body: <p>Run following code give me the wrong results:</p>
  <p>code</p>
  <pre><code>import kotlinx.coroutines.*
  
  fun timeElapsed(nano: Long, msg: String){
      println(&quot;$msg milliseconds: ${(System.nanoTime()-nano)/1000000}&quot;)
  }
  suspend fun main(): Unit = coroutineScope {
      val start = System.nanoTime()
      withTimeout(700) { 
          println(&quot;in timout&quot;)
          timeElapsed(start, &quot;timeout before delay&quot;)
          delay(900)
          println(&quot;not show?&quot;)
      }
  }
  </code></pre>
  <p>wrong result</p>
  <pre><code>in timout
  timeout before delay milliseconds: 16
  not show?
  Exception in thread &quot;main&quot; kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 700 ms
  </code></pre>
  <p>run on <a href="https://play.kotlinlang.org/" rel="nofollow noreferrer">https://play.kotlinlang.org/</a> give me the expected result:</p>
  <pre><code>in timout
  timeout before delay milliseconds: 27
  Exception in thread &quot;main&quot; kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 700 ms
  </code></pre>
  <p>My gradle setup</p>
  <pre><code>plugins {
      id 'org.jetbrains.kotlin.jvm' version '1.6.21'
      id 'org.jetbrains.kotlin.plugin.serialization' version '1.6.21'
  }
  
  group 'intro-coroutines'
  version '1.0-SNAPSHOT'
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib&quot;
      implementation &quot;org.jetbrains.kotlin:kotlin-reflect&quot;
      implementation(&quot;org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.2&quot;)
  
      def coroutines_version = '1.6.1'
      implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version&quot;
      implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-swing:$coroutines_version&quot;
      implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$coroutines_version&quot;
      implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:$coroutines_version&quot;
      implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-debug:$coroutines_version&quot;
  </code></pre>
  <p>Intellij version:
  Build #IU-221.5080.210, built on April 11, 2022</p>
  <p>kotline plugin version:
  221-1.7.0-Beta-release-135-IJ5080.210</p>
  <p>Java SDK: JavaSE-1.8</p>
  <p>what could possibly go wrong?</p>