Commit ad38485
test(rails): run distributed_tracing shared example against :solid_queue
Opts the SolidQueue adapter spec into the distributed_tracing meta so
all five tracing examples (producer span, trace propagation, messaging
span data, user propagation, worker hub isolation) run against
:solid_queue alongside the existing :test adapter coverage.
Two SolidQueue-specific harness adjustments were needed to make this
work on the SQLite-backed test setup:
- drain only wraps in travel_to when the caller passes an explicit
`at:`. Without this, the inner travel_to(Time.current) collides with
the outer travel block in messaging_span_data.rb's latency assertion.
- worker_hub_isolation.rb now spawns its threads through a `worker_thread`
harness hook (default = `Thread.new`). The :solid_queue spec overrides
this hook to allocate an isolated SQLite shard per spawned thread via
`connects_to(shards: ...)` + `connected_to(shard:)`. Each worker
thread reads/writes its own SolidQueue tables, eliminating the
SQLite3::BusyException that two concurrent perform_later/drain
pipelines on the shared test DB would otherwise raise. The contract
the spec enforces — concurrent jobs in different threads do not
cross-pollute Sentry scope — holds the same way it does on :test.
Verified GREEN on Rails 6.1 (SQ skipped, :test adapter only),
7.1, and 8.1 via ./bin/test --version.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a157c4f commit ad38485
1 file changed
Lines changed: 60 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
14 | 67 | | |
15 | 68 | | |
16 | 69 | | |
| |||
33 | 86 | | |
34 | 87 | | |
35 | 88 | | |
36 | | - | |
| 89 | + | |
37 | 90 | | |
38 | 91 | | |
39 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
40 | 98 | | |
41 | 99 | | |
42 | 100 | | |
| 101 | + | |
43 | 102 | | |
44 | 103 | | |
0 commit comments