Skip to content

Conversation

@tstirrat15
Copy link
Contributor

Description

See https://github.com/authzed/spicedb/actions/runs/21007920564/job/60396619281?pr=2818. We were getting test flakes from write failures that were the result of too much load on the memdb instance. For this reason, we're allowing the set of Memdb tests to run in parallel with other tests, but the test itself will not be parallelized to ensure that we aren't hammering the instance.

Changes

  • Turn off parallelism for memdb tests

Testing

Review.

@tstirrat15 tstirrat15 requested a review from a team as a code owner January 14, 2026 20:35
@github-actions github-actions bot added area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Jan 14, 2026
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.45%. Comparing base (0b5d8c5) to head (80b7a89).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2820      +/-   ##
==========================================
- Coverage   78.46%   78.45%   -0.00%     
==========================================
  Files         459      459              
  Lines       44674    44674              
==========================================
- Hits        35048    35044       -4     
- Misses       6769     6772       +3     
- Partials     2857     2858       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tstirrat15
Copy link
Contributor Author

Hmm... The memdb tests are already spinning up a separate memdb instance per test, so it's not likely resource contention within a single database.

@tstirrat15 tstirrat15 marked this pull request as draft January 14, 2026 20:39
func TestMemdbDatastore(t *testing.T) {
t.Parallel()
test.All(t, memDBTest{}, true)
// NOTE: The individual tests are not parallelized because enough write traffic will cause
Copy link
Contributor

@miparnisari miparnisari Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't understand how this fixes things. Each individual test is creating its own memdb instance. For example:

func RegisterRelationshipCountersInParallelTest(t *testing.T, tester DatastoreTester) {
	rawDS, err := tester.New(0, veryLargeGCInterval, veryLargeGCWindow, 1)

could it be that the default number of retries is 10 and this test is doing 10 parallel writes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh hmmm... yeah I suppose we could reduce it to 9 and see if that helps?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. but don't harcode to 9, use numAttempts - 1 and maybe rename numAttempts to defaultNumAttempts :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants