Is it possible to have Oban running the jobs normally with Ecto.Sandbox?

It’s possible to run Oban normally in acceptance tests using a setup similar to the one you showed above, provided you’re doing everything within the same transaction.

Oban Pro has a dedicated start_supervised_oban!/1 helper to facilitate acceptance testing within the sandbox.

start_supervised_oban!(repo: MyApp.Repo, stage_interval: 10, queues: [alpha: 10])

Note that stage_interval was added in Oban v2.14, and the undocumented poll_interval was removed.

2 Likes