Repository navigation
Fix flaky stats spec size comparisons across collStats calls - #768
Merged
Merged
Conversation
WiredTiger index and storage sizes can change between collStats commands as data is checkpointed, so exact equality against a second command is racy. Assert size fields from a single response and keep deterministic fields exact. Co-authored-by: Scott Taylor <smtlaissezfaire@users.noreply.github.com>
GitHub ubuntu-latest now runs kernel 6.19+, and mongo:8.0 exits at startup (SERVER-121912). Set GLIBC_TUNABLES so tcmalloc rseq is enabled and the container can start. Co-authored-by: Scott Taylor <smtlaissezfaire@users.noreply.github.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
spec/functional/stats_spec.rbcompared WiredTiger size stats from two separatecollStatscommands. Those sizes (index size, storage size, data size) can change between calls as data is checkpointed, so exact equality is racy.This showed up in CI on Ruby 3.4 / rails6_1 / mongo:4.4:
Change
Size assertions now use a single
Docs.statsresponse:size,storage_size,total_index_size, andlast_extent_sizemust be numeric and positiveavg_obj_sizemust matchsize / countfrom that same responsetotal_index_sizeand matchnindexesscale: 1024is proven viascale_factoron the scaled response, plus the same internal size consistency (notscaled == unscaled / 1024across two commands)Deterministic fields (
count,ns,nindexes,numExtents,paddingFactor,userFlags) stay exact.CI
The first Actions run was 65/66 green. The remaining job (
Ruby 4/rails8_0/mongo:8.0) never started mongod: GitHububuntu-latestis now on Linux 6.19+, and MongoDB 8.0 exits at startup (SERVER-121912). That same job is already red onmaster.This PR sets
GLIBC_TUNABLES=glibc.pthread.rseq=1on the mongo service so 8.0 can start on those kernels.Test plan
bundle exec rspec spec/functional/stats_spec.rbagainst local MongoDB (20 consecutive passes)