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

Stop using tokio in test which runs all futures sync #114

Merged
merged 1 commit into from
Jul 14, 2024

Conversation

pgerber
Copy link
Contributor

@pgerber pgerber commented Jul 12, 2024

futures::executor::block_on() runs a future to completion in the current thread and there as nothing being spawned to a worker thread (e.g. tokio::spawn()).

Let's make it clear that nothing is running on the tokio runtime by removing it.

I'm not sure this is the right approach. Is there something here you explicitly want to have tested on the tokio runtime or perhaps even a different thread?

futures::executor::block_on() runs a future to completion in the
current thread and there as nothing being spawned to a worker
thread (e.g. tokio::spawn()).

Let's make it clear that nothing is running on the tokio runtime
by removing it.
@palfrey
Copy link
Owner

palfrey commented Jul 14, 2024

Good catch. I suspect mostly copy/paste from the referenced Stack Overflow answer. The only thing that needed testing was that an async function run entirely within the catch_unwind block still did the correct cleanup in the face of an assertion, and the block_on does that.

Thanks!

@palfrey palfrey merged commit 870d278 into palfrey:main Jul 14, 2024
7 checks passed
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