Skip to content

In the 5.0 rc, lock expiry doesn't work #306

@eloff

Description

@eloff

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions