Skip to content

test(lock_manager): add 8 new unit tests#37

Merged
poyrazK merged 1 commit intomainfrom
feat/lock-manager-tests
Apr 15, 2026
Merged

test(lock_manager): add 8 new unit tests#37
poyrazK merged 1 commit intomainfrom
feat/lock-manager-tests

Conversation

@poyrazK
Copy link
Copy Markdown
Owner

@poyrazK poyrazK commented Apr 15, 2026

Summary

Add 8 new unit tests for LockManager to tests/lock_manager_tests.cpp.

New Tests

  1. UnlockNonExistent - verify unlocking non-existent lock returns false
  2. ExclusiveBlocksShared - exclusive blocks shared lock acquisition
  3. SharedBlocksExclusive - shared blocks exclusive lock acquisition
  4. UnlockReleasesOnlyTxn - unlock only releases specific transaction's lock
  5. LockSameRIDTwice - verify re-acquisition is idempotent
  6. MultipleSharedLocks - three transactions can hold shared locks
  7. LockDifferentRIDs - transactions hold locks on different RIDs independently
  8. ExclusiveThenShared - exclusive followed by shared on different RID succeeds

Test plan

  • Build passes
  • All 13 tests pass (5 existing + 8 new)

- UnlockNonExistent: verify unlocking non-existent lock returns false
- ExclusiveBlocksShared: exclusive blocks shared lock acquisition
- SharedBlocksExclusive: shared blocks exclusive lock acquisition
- UnlockReleasesOnlyTxn: unlock only releases specific transaction's lock
- LockSameRIDTwice: verify re-acquisition is idempotent
- MultipleSharedLocks: three transactions can hold shared locks
- LockDifferentRIDs: transactions hold locks on different RIDs independently
- ExclusiveThenShared: exclusive followed by shared on different RID succeeds
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

Warning

Rate limit exceeded

@poyrazK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 55 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 57 minutes and 55 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dbf3ca82-c565-42d2-af94-356682dd783d

📥 Commits

Reviewing files that changed from the base of the PR and between ff56ae6 and fb61d2e.

📒 Files selected for processing (1)
  • tests/lock_manager_tests.cpp
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/lock-manager-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Owner Author

@poyrazK poyrazK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay to merge those new tests

@poyrazK poyrazK merged commit 57fc3f8 into main Apr 15, 2026
9 checks passed
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

Successfully merging this pull request may close these issues.

1 participant