Skip to content

Keep spec cache deletions out of the shared cache - #491

Closed
apiology wants to merge 1 commit into
masterfrom
uncache-specs-use-private-cache
Closed

apiology wants to merge 1 commit into
masterfrom
uncache-specs-use-private-cache

Conversation

@apiology

Copy link
Copy Markdown
Owner

Claude: This PR was written by Claude Code on behalf of @apiology.

Problem

Two rspec processes sharing a cache fail external_spec:

# expected ["gem-with-yard-macros", "racc"] to include "backport"
expect(gem_names).to include('backport')   # spec/external_spec.rb:85
# expected `[].one?` to be truthy, got false
expect(backport_method_pins).to be_one     # spec/external_spec.rb:93

A full run fails while the same file run alone passes, so it looks like a flaky or order-dependent spec.

Solution

Run the examples that uncache backport (in external_spec, library_spec and yardoc_spec) against a temporary copy of the cache, so they no longer delete entries another process is reading.

Test plan

  • Before: two concurrent rspec spec/external_spec.rb on one SOLARGRAPH_CACHE failed in 2 of 3 rounds; deleting the backport/nokogiri/reverse_markdown .ser files during a run reproduces :42, :49, :61, :85 and :93.
  • After: 4 rounds of external_spec concurrent with external_spec + library_spec + yardoc_spec, all passing.

external_spec, library_spec and yardoc_spec uncache backport from the
shared cache directory. Another rspec process using the same cache
(same branch, so same SOLARGRAPH_FORCE_VERSION work dir) then finds
backport uncached and fails external_spec:42, :49, :61, :85 and :93.
Run those examples against a temporary copy of the cache instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LTpguHxFEQL9KJ7MGedKby
apiology added a commit that referenced this pull request Nov 11, 2026
external_spec and library_spec uncache backport from the shared cache
directory, so another rspec process using the same cache finds it
uncached and fails. Run those examples against a temporary copy of the
cache instead, as #491 does on master.

yardoc_spec needs no such hook here: it already stubs yard_dir to a
temporary directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LTpguHxFEQL9KJ7MGedKby
@apiology

Copy link
Copy Markdown
Owner Author

Claude: Folded into #44 (commit 24d36a4, Delete cache entries only in a private cache).

@apiology apiology closed this Nov 11, 2026
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