Skip to content

Commit

Permalink
Merge pull request #890 from akoshelev/role-in-trace
Browse files Browse the repository at this point in the history
Print helper role inside `TestWorld` spans
  • Loading branch information
martinthomson authored Dec 11, 2023
2 parents bc1b3f0 + 3e9f55c commit dc7fcf7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ipa-core/src/test_fixture/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,12 @@ impl TestWorld {
{
let input_shares = input.share_with(&mut thread_rng());
#[allow(clippy::disallowed_methods)] // It's just 3 items.
let output =
join_all(zip(contexts, input_shares).map(|(ctx, shares)| helper_fn(ctx, shares)))
.instrument(span)
.await;
let output = join_all(zip(contexts, input_shares).map(|(ctx, shares)| {
let role = ctx.role();
helper_fn(ctx, shares).instrument(tracing::trace_span!("", role = ?role))
}))
.instrument(span)
.await;
<[_; 3]>::try_from(output).unwrap()
}
}
Expand Down

0 comments on commit dc7fcf7

Please sign in to comment.