Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 34 for Sleep (0.13 sec)

  1. okhttp-testing-support/src/main/kotlin/okhttp3/TestUtilJvm.kt

       * java/lang/ref/FinalizationTester.java
       */
      @Throws(Exception::class)
      @JvmStatic
      fun awaitGarbageCollection() {
        Runtime.getRuntime().gc()
        Thread.sleep(100)
        System.runFinalization()
      }
    
      @JvmStatic
      fun assumeNetwork() {
        try {
          InetAddress.getByName("www.google.com")
        } catch (uhe: UnknownHostException) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/CallKotlinTest.kt

        assertThat(server.takeRequest().sequenceNumber).isEqualTo(0)
    
        // Give the socket a chance to become stale.
        connection!!.idleAtNs -= IDLE_CONNECTION_HEALTHY_NS
        Thread.sleep(250)
    
        val requestB =
          Request(
            url = server.url("/"),
            body = "b".toRequestBody("text/plain".toMediaType()),
          )
        val responseB = client.newCall(requestB).execute()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/DuplexTest.kt

        }
      }
    
      @Test
      fun fullCallTimeoutDoesNotApplyOnceConnected() {
        enableProtocol(Protocol.HTTP_2)
        val body =
          MockStreamHandler()
            .sendResponse("response A\n")
            .sleep(750, TimeUnit.MILLISECONDS)
            .sendResponse("response B\n")
            .receiveRequest("request C\n")
            .exhaustResponse()
            .exhaustRequest()
        server.enqueue(
          MockResponse.Builder()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 23.9K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

      private fun waitForConnectionShutdown(connection: RealConnection?) {
        if (connection!!.isHealthy(false)) {
          Thread.sleep(100L)
        }
        if (connection.isHealthy(false)) {
          Thread.sleep(2000L)
        }
        if (connection.isHealthy(false)) {
          throw TimeoutException("connection didn't shutdown within timeout")
        }
      }
    
      /**
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/EventListenerTest.kt

        }
    
        override fun writeTo(sink: BufferedSink) {
          try {
            var i = 0
            while (i < contentLength()) {
              sink.write(chunk!!)
              sink.flush()
              Thread.sleep(100)
              i += chunk.size
            }
          } catch (e: IOException) {
            ioe = e
          } catch (e: InterruptedException) {
            throw RuntimeException(e)
          }
        }
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 56.9K bytes
    - Viewed (0)
  6. okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt

            // Some number of tests will report here, but not fail due to this delay.
            println("Delaying to avoid flakes")
            Thread.sleep(500L)
            println("After delay: " + connectionPool.connectionCount())
          }
    
          connectionPool.evictAll()
          assertEquals(0, connectionPool.connectionCount()) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/connection/RealConnectionPool.kt

       * Performs maintenance on this pool, evicting the connection that has been idle the longest if
       * either it has exceeded the keep alive limit or the idle connections limit.
       *
       * Returns the duration in nanoseconds to sleep until the next scheduled call to this method.
       * Returns -1 if no further cleanups are required.
       */
      fun closeConnections(now: Long): Long {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 16.2K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/internal/http/CancelTest.kt

          it is ResponseFailed
    
      private fun sleep(delayMillis: Int) {
        try {
          Thread.sleep(delayMillis.toLong())
        } catch (e: InterruptedException) {
          Thread.currentThread().interrupt()
        }
      }
    
      private fun cancelLater(
        call: Call,
        delayMillis: Int,
      ): CountDownLatch {
        val latch = CountDownLatch(1)
        Thread {
          sleep(delayMillis)
          if (cancelMode == CANCEL) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  9. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

       * response is ready.
       */
      @Test
      fun dispatchBlocksWaitingForEnqueue() {
        Thread {
          try {
            Thread.sleep(1000)
          } catch (ignored: InterruptedException) {
          }
          server.enqueue(
            MockResponse.Builder()
              .body("enqueued in the background")
              .build(),
          )
        }.start()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 23.5K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/CacheTest.kt

        assertThat(response1.header("Allow")).isNull()
        assertThat((response1.receivedResponseAtMillis - t0).toDouble()).isCloseTo(0.0, 250.0)
    
        // A conditional cache hit updates the cache.
        Thread.sleep(500) // Make sure t0 and t1 are distinct.
        val t1 = System.currentTimeMillis()
        val response2 = get(server.url("/a"))
        assertThat(response2.code).isEqualTo(HttpURLConnection.HTTP_OK)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 108.6K bytes
    - Viewed (0)
Back to top