* make self-tracing public
* address review comments
* try to fix doctest
* adjust imports to fit standard
* more documentation
---------
Co-authored-by: Ariel Ben-Yehuda <[email protected]>
When a `?` operator is used in a tokio entry point function (wrapped in
`#[tokio::main]`), which has a Option or Result return type, but where
the function does not actually return that type correctly, currently the
compiler returns two errors instead of just one. The first of which is
incorrect and only exists due to the macro expanding to an async block.
```
cannot use the `?` operator in an async block that returns `()`
```
This commit is a characterization test for this behavior to help show
when it's fixed (or even changed for better / worse)
The test's previous iteration could sometimes flake since we didn't
await the completion of the first task. Since the tasks only existed to
`move` the relevant `rx`'s in, to force a drop, we can omit them
entirely and drop the `rx`s via `drop()`. This prevents any
scheduling-related flakes.
On WebAssembly the notification state was not checked
before sleeping and thus wrongfully ignored.
Additionally this refines the check whether threads are
available on a particular WebAssembly target.
In #6112, tests for the tracing instrumentation were introduced. They
had to live in their own test crate under `tokio/tests` because the
`tracing-mock` crate that the tests use had not yet been published to
crates.io.
Now `tracing-mock` has been published to crates.io and so the separate
test crate and separate job to run it are no longer necessary. The
tracing instrumentation tests can be placed in with the other
integration tests in the `tokio` crate.
The tests themselves have also been updated to match the changes in the
`tracing-mock` API since the version which was being used.