Skip to content

Fix flaky getOrUpdateOpt test - #391

Open
stasimus wants to merge 2 commits into
experimentingfrom
fix-flaky-getOrUpdateOpt
Open

stasimus wants to merge 2 commits into
experimentingfrom
fix-flaky-getOrUpdateOpt

Conversation

@stasimus

@stasimus stasimus commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

The second getOrUpdateOpt started via startEnsure could reach the cache after the first load already completed with None and removed the entry, so it did its own load and returned Some(0). Dropped the waiter, same shape as the getOrUpdateOpt1 test. Seen in https://github.com/evolution-gaming/scache/actions/runs/33754583586

Summary by CodeRabbit

  • Tests
    • Expanded cache behavior coverage for sequential optional updates.
    • Verified initial empty results, value storage, and retention of an existing cached value.
    • Updated cache-hit metric expectations to match the revised scenario.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: Repository: evolution-gaming/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 55b49688-0d07-4658-a61d-b8d23fb1bfba

📥 Commits

Reviewing files that changed from the base of the PR and between 3241a22 and 83816ac.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 723ed1f7-f9ac-4afe-928d-51465bb33cc0

📥 Commits

Reviewing files that changed from the base of the PR and between e56ccb3 and 3241a22.

📒 Files selected for processing (1)
  • scache/src/test/scala/com/evolution/scache/CacheSpec.scala

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The getOrUpdateOpt test now uses sequential calls. It verifies an initial none, stores 0, confirms that an existing 0 is retained, and expects one cache hit.

Changes

getOrUpdateOpt test

Layer / File(s) Summary
Sequential optional update validation
scache/src/test/scala/com/evolution/scache/CacheSpec.scala
The test removes deferred coordination and validates three sequential getOrUpdateOpt calls. The metric expectation now includes one cache hit.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: mr-git

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: fixing the flaky getOrUpdateOpt test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

Comment thread scache/src/test/scala/com/evolution/scache/CacheSpec.scala
@stasimus
stasimus force-pushed the fix-flaky-getOrUpdateOpt branch from 3241a22 to 83816ac Compare September 30, 2026 08:46
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.

2 participants