Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for predictable (0.32 sec)

  1. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

        var i = 0
        while (i < 1024) {
          try {
            out!!.write(data)
            out.flush()
            if (i == 513) {
              // pause slightly after half way to make result more predictable
              Thread.sleep(100)
            }
          } catch (e: IOException) {
            break
          }
          i++
        }
        // Halfway +/- 0.5%
        assertThat(i.toFloat()).isCloseTo(512f, 5f)
      }
    
    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)
  2. okhttp/src/test/java/okhttp3/internal/connection/FastFallbackExchangeFinderTest.kt

     *
     * This test uses [TaskFaker] to deterministically test racy code. Each function in this test has
     * the same structure:
     *
     *  * prepare a set of plans, each with a predictable connect delay
     *  * attempt to find a connection
     *  * step through time, asserting that the expected side effects are performed.
     */
    internal class FastFallbackExchangeFinderTest {
      private val taskFaker = TaskFaker()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 24 04:40:49 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  3. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

        var i = 0
        while (i < 1024) {
          try {
            out.write(data)
            out.flush()
            if (i == 513) {
              // pause slightly after halfway to make result more predictable
              Thread.sleep(100)
            }
          } catch (e: IOException) {
            break
          }
          i++
        }
        // Halfway +/- 0.5%
        assertThat(i.toFloat()).isCloseTo(512f, 5f)
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 21.9K bytes
    - Viewed (0)
Back to top