Skip to content

Print chats when a test failed #3937

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 3 commits into from
Jan 9, 2023
Merged

Conversation

Hocuri
Copy link
Collaborator

@Hocuri Hocuri commented Jan 9, 2023

E.g.

========== Chats of bob: ==========
Single#Chat#10: [email protected] [[email protected]]
--------------------------------------------------------------------------------
Msg#10:  (Contact#Contact#10): hellooo [FRESH]
Msg#11:  (Contact#Contact#10): hellooo without mailing list [FRESH]
--------------------------------------------------------------------------------

========== Chats of alice: ==========
Single#Chat#10: [email protected] [[email protected]]
--------------------------------------------------------------------------------
Msg#10: Me (Contact#Contact#Self): hellooo  √
Msg#11: Me (Contact#Contact#Self): hellooo without mailing list  √
--------------------------------------------------------------------------------

I found this very useful sometimes, so, let's try to re-introduce it (it was removed in #3449)

#skip-changelog since it's only for debugging

E.g.
```
========== Chats of bob: ==========
Single#Chat#10: [email protected] [[email protected]]
--------------------------------------------------------------------------------
Msg#10:  (Contact#Contact#10): hellooo [FRESH]
Msg#11:  (Contact#Contact#10): hellooo without mailing list [FRESH]
--------------------------------------------------------------------------------

========== Chats of alice: ==========
Single#Chat#10: [email protected] [[email protected]]
--------------------------------------------------------------------------------
Msg#10: Me (Contact#Contact#Self): hellooo  √
Msg#11: Me (Contact#Contact#Self): hellooo without mailing list  √
--------------------------------------------------------------------------------
```

I found this very useful sometimes, so, let's try to re-introduce it (it
was removed in #3449)
@link2xt
Copy link
Collaborator

link2xt commented Jan 9, 2023

What about this comment, something has changed in tokio?

@Hocuri
Copy link
Collaborator Author

Hocuri commented Jan 9, 2023

I don't know, maybe he didn't think/know about block_in_place when he wrote this comment, maybe it was added since then.

And using block_on alone would panic, so, the comment is kinda right.

@Hocuri
Copy link
Collaborator Author

Hocuri commented Jan 9, 2023

The documentation actually says you can do this:

Code running inside block_in_place may use block_on to reenter the async context.

@link2xt
Copy link
Collaborator

link2xt commented Jan 9, 2023

Pushed two changes to make sure it does not panic if we create and drop runtime manually in different order.

@Hocuri Hocuri merged commit 8d11971 into master Jan 9, 2023
@Hocuri Hocuri deleted the hoc/print-chats-in-failing-tests branch January 9, 2023 21:46
@r10s
Copy link
Contributor

r10s commented Jan 9, 2023

nice!

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.

3 participants