Skip to content

Comments

test: fixup synctest usage in crdbpool#2910

Merged
tstirrat15 merged 1 commit intomainfrom
fixup-synctest-usage-in-crdbpool
Feb 23, 2026
Merged

test: fixup synctest usage in crdbpool#2910
tstirrat15 merged 1 commit intomainfrom
fixup-synctest-usage-in-crdbpool

Conversation

@tstirrat15
Copy link
Contributor

Follow-on to #2754

Description

Synctest runs its tests inside special goroutines, which means we need to use assert inside of them (at least as I understand it; I might be wrong on this point).

We also want to Wait() to ensure that all goroutines have settled.

Changes

  • synctest refactors

Testing

Review.

@tstirrat15 tstirrat15 requested a review from a team as a code owner February 19, 2026 18:58
@tstirrat15 tstirrat15 force-pushed the fixup-synctest-usage-in-crdbpool branch from faa3910 to e38f426 Compare February 19, 2026 18:58
@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 Feb 19, 2026
Copy link
Contributor Author

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

See comments


retryPool := createTestRetryPool(testPool)
ctx, cancel := context.WithCancel(context.Background())
ctx, cancel := context.WithCancel(t.Context())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why testifylint didn't catch this

deadline, hasDeadline := acquireContext.Deadline()
assert.True(t, hasDeadline, "acquire context should have a deadline")
expectedDeadline := startTime.Add(acquireTimeout)
assert.Equal(t, expectedDeadline, deadline, "deadline should be correct")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only change that isn't rewrapping or adding synctest.Wait - with synctest the time values are exact, so we can assert directly on them without relying on bounds.

@miparnisari miparnisari changed the title Fixup synctest usage in crdbpool test: fixup synctest usage in crdbpool Feb 19, 2026
})

require.Error(t, err)
require.Error(t, err) //nolint:testifylint // we're inside a goroutine so this is appropriate
Copy link
Contributor

Choose a reason for hiding this comment

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

you wrote the same comment on line 109 but with assert???

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, that was incorrect.

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2910      +/-   ##
==========================================
- Coverage   74.54%   74.51%   -0.02%     
==========================================
  Files         484      484              
  Lines       59228    59228              
==========================================
- Hits        44145    44130      -15     
- Misses      11990    12001      +11     
- Partials     3093     3097       +4     

☔ 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 tstirrat15 force-pushed the fixup-synctest-usage-in-crdbpool branch from e38f426 to d4cade4 Compare February 23, 2026 14:14
@tstirrat15 tstirrat15 enabled auto-merge (squash) February 23, 2026 14:22
@tstirrat15 tstirrat15 merged commit f3e150e into main Feb 23, 2026
43 of 44 checks passed
@tstirrat15 tstirrat15 deleted the fixup-synctest-usage-in-crdbpool branch February 23, 2026 14:27
@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 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.

2 participants