Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eloff opened this issue Sep 26, 2024 · 0 comments
Open

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

eloff opened this issue Sep 26, 2024 · 0 comments

Comments

@eloff
Copy link

eloff commented Sep 26, 2024

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);
    ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant