Skip to content

Commit

Permalink
speedup core tests (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
himadieievsv authored Jan 4, 2024
1 parent caa35af commit 347cdb3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class RedLockTest {
every { backend.setLock(eq("test"), any(), any()) } returns null
every { backend.removeLock(eq("test"), any()) } returns "OK"

val redLock = RedLock(listOf(backend))
val redLock = RedLock(listOf(backend), retryDelay = 20.milliseconds, retryCount = 3)
val permit = redLock.lock("test")

assertFalse(permit)
Expand Down Expand Up @@ -197,7 +197,7 @@ class RedLockTest {
every { backend.removeLock(eq("test"), any()) } returns "OK"
}

val redLock = RedLock(instances)
val redLock = RedLock(instances, retryDelay = 20.milliseconds, retryCount = 3)
val permit = redLock.lock("test")

assertFalse(permit)
Expand All @@ -221,7 +221,7 @@ class RedLockTest {
every { backend.removeLock(eq("test"), any()) } returns "OK"
}

val redLock = RedLock(instances)
val redLock = RedLock(instances, retryDelay = 20.milliseconds, retryCount = 3)
val permit = redLock.lock("test", 20.milliseconds)

assertFalse(permit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class SemaphoreTest {
} returns "OK"
}

val semaphore = Semaphore(instances, 3)
val semaphore = Semaphore(instances, 3, 20.milliseconds, 3)
val permit = semaphore.lock("test")

assertFalse(permit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SimpleLockTest {
// every { redis.set(eq("test"), any(), any()) } returns null
every { backend.setLock(eq("test"), any(), any()) } returns null

val simpleLock = SimpleLock(backend)
val simpleLock = SimpleLock(backend, retryDelay = 20.milliseconds, retryCount = 3)
val permit = simpleLock.lock("test", 1.seconds)

assertFalse(permit)
Expand Down

0 comments on commit 347cdb3

Please sign in to comment.