Clean
This commit is contained in:
parent
c86d949680
commit
dcb6933eaa
|
@ -8,7 +8,7 @@ tk.reset()
|
||||||
describe("redlockImpl", () => {
|
describe("redlockImpl", () => {
|
||||||
describe("doWithLock", () => {
|
describe("doWithLock", () => {
|
||||||
const config = new DBTestConfiguration()
|
const config = new DBTestConfiguration()
|
||||||
const lockTtl = 30
|
const lockTtl = 25
|
||||||
|
|
||||||
function runLockWithExecutionTime({
|
function runLockWithExecutionTime({
|
||||||
opts,
|
opts,
|
||||||
|
@ -28,7 +28,7 @@ describe("redlockImpl", () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
it.each(Object.values(LockType))(
|
it.each(Object.values(LockType))(
|
||||||
"should return the task value",
|
"should return the task value and release the lock",
|
||||||
async (lockType: LockType) => {
|
async (lockType: LockType) => {
|
||||||
const expectedResult = generator.guid()
|
const expectedResult = generator.guid()
|
||||||
const mockTask = jest.fn().mockResolvedValue(expectedResult)
|
const mockTask = jest.fn().mockResolvedValue(expectedResult)
|
||||||
|
@ -64,7 +64,7 @@ describe("redlockImpl", () => {
|
||||||
const result = await runLockWithExecutionTime({
|
const result = await runLockWithExecutionTime({
|
||||||
opts,
|
opts,
|
||||||
task: mockTask,
|
task: mockTask,
|
||||||
executionTimeMs: lockTtl * 2,
|
executionTimeMs: lockTtl * 3,
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(result.executed).toBe(true)
|
expect(result.executed).toBe(true)
|
||||||
|
|
Loading…
Reference in New Issue