-
Notifications
You must be signed in to change notification settings - Fork 178
Open
Description
Occasionally the lock expiry works, but most of the time it doesn't.
This test fails 90% of the time.
it("won't lock twice", async () => {
const lockKeyD = `TEST_LOCK_KEY_D`;
const startTime = Date.now();
const lock = await redlock.acquire([lockKeyD], 1000);
// Blocks until the lock expires (90% of the time this just blocks until the test times out after 10 seconds!)
const lockC = await redlock.acquire([lockKeyD], 1);
const duration = Date.now() - startTime;
expect(duration).toBeGreaterThanOrEqual(1000);
await lockC!.release();
}, 10000);
```
Metadata
Metadata
Assignees
Labels
No labels