Skip to content

!feat: Call.Release takes context; add MustRelease #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 23, 2025

Conversation

spikecurtis
Copy link
Collaborator

@spikecurtis spikecurtis commented May 23, 2025

BREAKING CHANGE

Adds a context.Context to (*Call.).Release() and a new MustRelease(), since releasing a call can be blocking. Use like

err := call.Release(ctx)
if err != nil {
  t.Error(err.Error())
}

or more succinctly

call.MustRelease(ctx)

This, combined with a per-test timeout context, should make it much easier to debug issues if you have a call that gets trapped by more than one trap.

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@spikecurtis spikecurtis requested a review from mafredri May 23, 2025 12:22
@spikecurtis spikecurtis self-assigned this May 23, 2025
@spikecurtis spikecurtis marked this pull request as ready for review May 23, 2025 12:24
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Unfortunate, but I agree it's worth breaking the API here, LGTM!

Copy link
Collaborator Author

spikecurtis commented May 23, 2025

Merge activity

  • May 23, 12:29 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 23, 12:29 PM UTC: @spikecurtis merged this pull request with Graphite.

@spikecurtis spikecurtis merged commit 09f5542 into main May 23, 2025
1 check passed
@spikecurtis spikecurtis deleted the spike/release-ctx branch June 3, 2025 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants