Skip to content

fix: Stream debug impl to not print Waker #840

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

Merged
merged 2 commits into from
Apr 9, 2025

Conversation

LucioFranco
Copy link
Member

This implements a custom Debug impl for Stream so that the Waker type stored in the *_task fields does not get printed. This is because the Debug impl of Waker prints a pointer which is non-deterministic. My use-case here is that I am trying to make turmoil deterministic and testing it with h2 via comparing trace logs between two same seeded runs.

This implements a custom `Debug` impl for `Stream` so that the `Waker`
type stored in the `*_task` fields does not get printed. This is because
the `Debug` impl of `Waker` prints a pointer which is non-deterministic.
My use-case here is that I am trying to make turmoil deterministic and
testing it with h2 via comparing trace logs between two same seeded
runs.
@LucioFranco LucioFranco requested a review from seanmonstar April 9, 2025 14:44
Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

Wow, it'd be really nice to finally get #[debug(hidden)] etc attributes...

@LucioFranco
Copy link
Member Author

Attempted CI fix for msrv #841

@LucioFranco
Copy link
Member Author

Wow, it'd be really nice to finally get #[debug(hidden)] etc attributes...

Maybe in Rust 2.0? 😂

@LucioFranco LucioFranco merged commit d021e8c into master Apr 9, 2025
6 checks passed
@LucioFranco LucioFranco deleted the lucio/stream-debug-fix branch April 9, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants