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

fix atomic factory soak test #419

Merged
merged 5 commits into from
Oct 15, 2023
Merged

fix atomic factory soak test #419

merged 5 commits into from
Oct 15, 2023

Conversation

bitfaster
Copy link
Owner

@bitfaster bitfaster commented Oct 15, 2023

Soak test for AtomicFactory fails intermittently:

[xUnit.net 00:00:59.66]     AtomicFactorySoakTests.WhenGetOrAddIsConcurrentValuesCreatedAtomically [FAIL]
  Failed Atomic.AtomicFactorySoakTests.WhenGetOrAddIsConcurrentValuesCreatedAtomically [26 ms]
  Error Message:
   Expected counters.Sum(x => x) to be 1024, but found 1071 (difference of 47).

This is due to items being evicted by ConcurrentLru (which is not expected given that item count falls within capacity). Switch to a pre-allocated ConcurrentDictionary, and investigate the warmup bug separately.

Also moved the volatile read in the AtomicFactory code.

@bitfaster bitfaster changed the title volatile fix atomic factory Oct 15, 2023
@bitfaster bitfaster changed the title fix atomic factory fix atomic factory soak test Oct 15, 2023
Alex Peck added 2 commits October 14, 2023 18:34
@coveralls
Copy link

Coverage Status

coverage: 97.744% (-0.05%) from 97.791% when pulling 40a71ee on users/alexpeck/atomicvol into 42f1f11 on main.

@bitfaster bitfaster merged commit ee1da5f into main Oct 15, 2023
13 checks passed
@bitfaster bitfaster deleted the users/alexpeck/atomicvol branch October 15, 2023 01:52
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