k6 group() preserves metric context across asynchronous calls
When an asynchronous test flow needs requests and checks to remain in one group across `await`, run it with the experimental `async-metric-context` feature and use an async `group()` callback. `group_duration` then measures until the callback’s returned promise settles.
k6 run --features async-metric-context <script.js>