spicedb icon indicating copy to clipboard operation
spicedb copied to clipboard

Rewrite CRDB pool retry tests to use synctest

Open ivanauth opened this issue 2 months ago • 1 comments

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
  • Rename BuildMemoryUsageProvider to MustBuildMemoryUsageProvider for consistency

Benefits

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

ivanauth avatar Dec 09 '25 01:12 ivanauth

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 77.63%. Comparing base (ae83447) to head (483cf87). :warning: Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2754      +/-   ##
==========================================
+ Coverage   77.03%   77.63%   +0.61%     
==========================================
  Files         466      471       +5     
  Lines       49199    49564     +365     
==========================================
+ Hits        37896    38475     +579     
+ Misses       8514     8248     -266     
- Partials     2789     2841      +52     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Dec 09 '25 01:12 codecov[bot]