Skip to content

test: use synctest in some CRDB pool retry tests#2754

Merged
miparnisari merged 2 commits intoauthzed:mainfrom
ivanauth:fix/issue-2713-crdb-retry-tests-synctest
Feb 13, 2026
Merged

test: use synctest in some CRDB pool retry tests#2754
miparnisari merged 2 commits intoauthzed:mainfrom
ivanauth:fix/issue-2713-crdb-retry-tests-synctest

Conversation

@ivanauth
Copy link
Copy Markdown
Contributor

@ivanauth ivanauth commented Dec 9, 2025

Summary

Rewrites the CRDB pool retry tests to use Go's testing/synctest package for better time simulation and test reliability.

Fixes #2713

Changes

  • Wrap all retry tests in synctest.Test(t, func(t *testing.T) { ... })
  • Use t.Context() instead of context.Background()
  • Add t.Parallel() for concurrent test execution

Benefits

  • Tests no longer rely on real time delays
  • More deterministic test execution
  • Faster test runs with simulated time
  • Better parallel execution support

@ivanauth ivanauth requested a review from a team as a code owner December 9, 2025 01:09
@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 Dec 9, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.58%. Comparing base (f0f94ee) to head (22d64e9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2754       +/-   ##
===========================================
+ Coverage   50.01%   74.58%   +24.57%     
===========================================
  Files         417      484       +67     
  Lines       52438    58531     +6093     
===========================================
+ Hits        26224    43651    +17427     
+ Misses      23562    11810    -11752     
- Partials     2652     3070      +418     

☔ 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.

@ivanauth ivanauth force-pushed the fix/issue-2713-crdb-retry-tests-synctest branch from 1712d3c to 483cf87 Compare December 13, 2025 02:08
@ivanauth ivanauth force-pushed the fix/issue-2713-crdb-retry-tests-synctest branch from 483cf87 to e65d882 Compare January 8, 2026 22:00
Comment thread internal/datastore/crdb/pool/pool_test.go Outdated
@miparnisari miparnisari changed the title Rewrite CRDB pool retry tests to use synctest test: use synctest in some CRDB pool retry tests Feb 12, 2026
@miparnisari miparnisari enabled auto-merge (squash) February 13, 2026 16:24
@miparnisari miparnisari force-pushed the fix/issue-2713-crdb-retry-tests-synctest branch from 9bb0d42 to 22d64e9 Compare February 13, 2026 16:24
@miparnisari miparnisari merged commit 1ca0250 into authzed:main Feb 13, 2026
76 of 78 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

Rewrite CRDB pool retry tests to use synctest

2 participants