Skip to content

Apply stability fix to TLruTickCount64PolicyTests.UpdateUpdatesTickCount#763

Merged
bitfaster merged 1 commit intomainfrom
copilot/fix-tlru-tick-count-update
Apr 14, 2026
Merged

Apply stability fix to TLruTickCount64PolicyTests.UpdateUpdatesTickCount#763
bitfaster merged 1 commit intomainfrom
copilot/fix-tlru-tick-count-update

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

Summary

Applies the same stability fix from #759 to TLruTickCount64PolicyTests.UpdateUpdatesTickCount.

The previous implementation used a bare Task.Delay(1ms) which is unreliable on fast machines — the tick count may not advance in 1ms, causing the test to flake. The fix replaces it with a spin-wait loop that polls Duration.SinceEpoch().raw until it advances past the creation tick count (with a 1-second timeout), matching the pattern established in #759.

Changes

  • BitFaster.Caching.UnitTests/Lru/TLruTickCount64PolicyTests.cs: replaced await Task.Delay(1ms) with a bounded spin-wait loop in UpdateUpdatesTickCount

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 99.048% (-0.05%) from 99.093% — copilot/fix-tlru-tick-count-update into main

@bitfaster bitfaster marked this pull request as ready for review April 14, 2026 03:48
@bitfaster bitfaster merged commit 3d17aaa into main Apr 14, 2026
16 checks passed
@bitfaster bitfaster deleted the copilot/fix-tlru-tick-count-update branch April 14, 2026 03:48
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.

3 participants