Skip to content

Commit 9e83acd

Browse files
committed
Slightly more elaborate trace provider test.
1 parent 1363629 commit 9e83acd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/traces/provider/async/task.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@
1111

1212
describe Async::Task do
1313
it "traces tasks within active tracing" do
14-
context = nil
14+
parent_context = child_context = nil
1515

1616
Thread.new do
17-
Traces.trace("test") do
17+
Traces.trace("parent") do
18+
parent_context = Traces.trace_context
19+
1820
Async do
19-
context = Traces.trace_context
21+
child_context = Traces.trace_context
2022
end
2123
end
2224
end.join
2325

24-
expect(context).not.to be == nil
26+
expect(child_context).to have_attributes(
27+
trace_id: be == parent_context.trace_id
28+
)
2529
end
2630

2731
it "doesn't trace tasks outside of active tracing" do

0 commit comments

Comments
 (0)