Skip to content

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

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);
    ```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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