Skip to content

Bring back manual Sentry.Test allowance #1052

Description

@michallepicki

Problem Statement

allow_sentry_reports/2 documentation says that

Child processes are now automatically tracked via $callers.

(It also says that it will be removed in v13.0.0, but it still exists as a no-op)

Without this functionality, it is not possible to use Sentry.Test e.g. in async integration tests using phoenix_test_playwright or when testing e.g. Broadway, where the caller module is not in $callers.

Solution Brainstorm

Bring back possibility to manually allow sentry reports. For reference, e.g. Broadway documentation recommends using passing pid_with_access in metadata + allowing SQL sandbox via a telemetry hook to make it work with async tests. The same mechanism could be used with Sentry (in my case, instead of Ecto.Adapters.SQL.Sandbox.allow I would call MyApp.TestSandbox.allow, which would call both Sentry.Test.allow_sentry_reports and Ecto.Adapters.SQL.Sandbox.allow etc)

For reference also see https://hexdocs.pm/nimble_ownership/NimbleOwnership.html#allow/5 which is the standard way of implementing this

Activity

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

Metadata

Metadata

Assignees

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions