Add real concurrency coverage and actually run the adapter contract

- spec/support/adapter_contract.rb shipped shared examples ('a simply_couch
  adapter') that no spec ever included — the parity proof they document never
  ran. store_contract_spec.rb now includes them against the live Store.
- concurrency_spec.rb: the suite had zero multi-threaded examples despite the
  gem's core claims being CAS optimistic concurrency and Redis-replacement
  primitives. Adds: counter increments under 8 concurrent writers, lock
  granted to exactly one contender, with_lock mutual exclusion, stale-handle
  release after TTL expiry (must not unlock the new holder), same-attribute
  CAS conflict surfacing (no lost update), different-attribute auto-merge, and
  a 3-thread disjoint-attribute write storm.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
bterkuileandClaude Sonnet 5 committed 2026-07-06 18:42:17 -05:00
1 parent bde6df57f4
commit 9ce5aea23d
2 files changed
+117

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
require 'spec_helper'
# The adapter contract shared examples (spec/support/adapter_contract.rb) were
# shipped with the gem but never actually included by any spec — the parity
# proof they document did not run. This spec makes the Store honour it.
RSpec.describe SimplyBased::Store do
it_behaves_like 'a simply_couch adapter'
end