summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Wilson <jwilson@squareup.com>2024-04-14 00:17:49 -0400
committerGitHub <noreply@github.com>2024-04-14 00:17:49 -0400
commit2b1100eae2fcfc53d56f7fb0a55fd3a55d93f0db (patch)
treea8b7a5dab6ccbc663f587f6f9714559687e6f4b0
parent73c3ea5e510bfe6799a4984a413064e73087e9d4 (diff)
downloadokhttp4-2b1100eae2fcfc53d56f7fb0a55fd3a55d93f0db.tar.gz
Fake time in ConnectionPoolTest (#8360)
-rw-r--r--okhttp/src/test/java/okhttp3/internal/connection/ConnectionPoolTest.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/okhttp/src/test/java/okhttp3/internal/connection/ConnectionPoolTest.kt b/okhttp/src/test/java/okhttp3/internal/connection/ConnectionPoolTest.kt
index a69bab917..240816047 100644
--- a/okhttp/src/test/java/okhttp3/internal/connection/ConnectionPoolTest.kt
+++ b/okhttp/src/test/java/okhttp3/internal/connection/ConnectionPoolTest.kt
@@ -204,7 +204,7 @@ class ConnectionPoolTest {
}
@Test fun connectionPreWarmingHttp1() {
- val expireTime = System.nanoTime() + 1_000_000_000_000
+ val expireTime = factory.taskFaker.nanoTime + 1_000_000_000_000
routePlanner.autoGeneratePlans = true
routePlanner.defaultConnectionIdleAtNanos = expireTime
@@ -229,8 +229,8 @@ class ConnectionPoolTest {
}
@Test fun connectionPreWarmingHttp2() {
- val expireSooner = System.nanoTime() + 1_000_000_000_000
- val expireLater = System.nanoTime() + 2_000_000_000_000
+ val expireSooner = factory.taskFaker.nanoTime + 1_000_000_000_000
+ val expireLater = factory.taskFaker.nanoTime + 2_000_000_000_000
routePlanner.autoGeneratePlans = true
val address = routePlanner.address