Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for activeQueues (0.06 sec)

  1. okhttp/src/jvmTest/kotlin/okhttp3/internal/concurrent/TaskRunnerTest.kt

          // Do nothing.
        }
    
        taskFaker.advanceUntil(0.µs)
        assertThat(taskRunner.activeQueues()).containsExactly(redQueue, blueQueue)
    
        taskFaker.advanceUntil(100.µs)
        assertThat(taskRunner.activeQueues()).containsExactly(blueQueue)
    
        taskFaker.advanceUntil(200.µs)
        assertThat(taskRunner.activeQueues()).isEmpty()
    
        taskFaker.assertNoMoreTasks()
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 23K bytes
    - Viewed (0)
  2. okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt

          }
        }
      }
    
      private fun ensureAllTaskQueuesIdle() {
        val entryTime = System.nanoTime()
    
        for (queue in TaskRunner.INSTANCE.activeQueues()) {
          // We wait at most 1 second, so we don't ever turn multiple lost threads into
          // a test timeout failure.
          val waitTime = (entryTime + 1_000_000_000L - System.nanoTime())
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri May 30 21:28:20 UTC 2025
    - 10.5K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/internal/connection/ConnectionPoolTest.kt

        factory.newConnection(pool, routeA1)
        // Racy causing flaky tests
        // assertThat(taskRunner.activeQueues()).isNotEmpty()
        assertThat(taskRunnerThreads).isNotEmpty()
        Thread.sleep(100)
        for (t in taskRunnerThreads) {
          t.interrupt()
        }
        Thread.sleep(100)
        assertThat(taskRunner.activeQueues()).isEmpty()
      }
    
      @Test fun connectionPreWarmingHttp1() {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 31 04:18:40 UTC 2025
    - 12.9K bytes
    - Viewed (0)
  4. okhttp-testing-support/src/main/kotlin/okhttp3/internal/concurrent/TaskFaker.kt

          maxElements: Int,
        ) = error("unsupported")
      }
    
      /** Returns true if no tasks have been scheduled. This runs the coordinator for confirmation. */
      fun isIdle() = taskRunner.activeQueues().isEmpty()
    
      override fun close() {
        tasksExecutor.shutdownNow()
      }
    
      companion object {
        var instance = 0
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed May 28 23:28:25 UTC 2025
    - 11.9K bytes
    - Viewed (0)
  5. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/concurrent/TaskRunner.kt

      }
    
      /**
       * Returns a snapshot of queues that currently have tasks scheduled. The task runner does not
       * necessarily track queues that have no tasks scheduled.
       */
      fun activeQueues(): List<TaskQueue> {
        this.withLock {
          return busyQueues + readyQueues
        }
      }
    
      fun cancelAll() {
        assertLockHeld()
        for (i in busyQueues.size - 1 downTo 0) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:30:11 UTC 2025
    - 10.4K bytes
    - Viewed (0)
  6. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

        // Cause acceptConnections() to break out.
        serverSocket.closeQuietly()
    
        // Await shutdown.
        for (queue in taskRunner.activeQueues()) {
          if (!queue.idleLatch().await(5, TimeUnit.SECONDS)) {
            throw AssertionError("Gave up waiting for queue to shut down")
          }
        }
        taskRunnerBackend.shutdown()
      }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 02 20:36:00 UTC 2025
    - 40.3K bytes
    - Viewed (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/internal/http2/Http2ConnectionTest.kt

            .socket(peer.openSocket().asBufferedSocket(), "peer")
            .pushObserver(IGNORE)
            .build()
        connection.start(sendConnectionPreface = false)
        val queues = taskRunner.activeQueues()
        assertThat(queues).hasSize(1)
      }
    
      private fun data(byteCount: Int): Buffer = Buffer().write(ByteArray(byteCount))
    
      private fun assertStreamData(
        expected: String?,
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 31 04:18:40 UTC 2025
    - 75.5K bytes
    - Viewed (0)
Back to top