Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task: add tests for tracing instrumentation of tasks #6112

Merged
merged 2 commits into from
Oct 31, 2023

Conversation

hds
Copy link
Contributor

@hds hds commented Oct 26, 2023

Motivation

Tokio is instrumented with traces which can be used to analyze the
behavior of the runtime during execution or post-mortem. The
instrumentation is optional. This is where tokio-console collections
information.

There are currently no tests for the instrumentation.

Solution

In order to provide more stability to the instrumentation and prepare
for future changes, tests are added to verify the current behavior. The
tests are written using the tracing-mock crate. As this crate is still
unreleased, a separate test create has been added under tokio/tests
which is outside the workspace. This allows us to pull in both tracing
and tracing-mock from the tracing repository on GitHub without
affecting the rest of the tokio repository.

Once tracing-mock is published on crates.io (tokio-rs/tracing#539),
these tests can be moved in with the "normal" tokio integration tests.
The decision to add these tests now is due to the release of
tracing-mock taking a while, so it would be better to have tests while
we wait.

@hds hds force-pushed the hds/tracing-instrumentation-tests branch 4 times, most recently from b453786 to 5cb9f39 Compare October 26, 2023 12:15
@hds hds force-pushed the hds/tracing-instrumentation-tests branch 2 times, most recently from 1cc5fdb to a6c49fd Compare October 26, 2023 13:48
Tokio is instrumented with traces which can be used to analyze the
behavior of the runtime during execution or post-mortem. The
instrumentation is optional. This is where tokio-console collections
information.

There are currently no tests for the instrumentation.

In order to provide more stability to the instrumentation and prepare
for future changes, tests are added to verify the current behavior. The
tests are written using the `tracing-mock` crate. As this crate is still
unreleased, a separate test create has been added under `tokio/tests`
which is outside the workspace. This allows us to pull in both `tracing`
and `tracing-mock` from the tracing repository on GitHub without
affecting the rest of the tokio repository.

This change adds initial tests for the task instrumentation. Further
tests will be added in subsequent commits.

Once `tracing-mock` is published on crates.io (tokio-rs/tracing#539),
these tests can be moved in with the "normal" tokio integration tests.
The decision to add these tests now is due to the release of
`tracing-mock` taking a while, so it would be better to have tests while
we wait.
@hds hds force-pushed the hds/tracing-instrumentation-tests branch from a6c49fd to 32486b7 Compare October 26, 2023 13:50
@hds hds marked this pull request as ready for review October 26, 2023 14:24
@Darksonn Darksonn added A-tokio Area: The main tokio crate M-tracing Tracing support in Tokio labels Oct 31, 2023
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with using git dependencies for now, but I'd like to move to crates.io dependencies eventually. Thanks.

@Darksonn Darksonn merged commit ed32cd1 into master Oct 31, 2023
82 of 83 checks passed
@Darksonn Darksonn deleted the hds/tracing-instrumentation-tests branch October 31, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-tracing Tracing support in Tokio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants