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

For Task based tests, exceptions are printed twice #269

Closed
0x53A opened this issue Aug 3, 2018 · 6 comments · Fixed by #270
Closed

For Task based tests, exceptions are printed twice #269

0x53A opened this issue Aug 3, 2018 · 6 comments · Fixed by #270

Comments

@0x53A
Copy link
Contributor

0x53A commented Aug 3, 2018

grafik

@adamchester
Copy link
Contributor

Hi @0x53A, there is only one exception there (although it is an aggregate exception, so it contains one or more inner exceptions too), and the output is more or less what ToString() on the exception would generate.

Does this help?

@0x53A
Copy link
Contributor Author

0x53A commented Aug 3, 2018

Hi @adamchester, yes, the output is correct.

I didn't write it (I should have maybe elaborated a bit more instead of just posting a screenshot ;) ), but my intention was to propose to unwrap AggreagateExceptions.

This is really common and annoying with Task based tests from c#.

What do you think of #270?

@adamchester
Copy link
Contributor

My preference is not to hide the fact that it’s wrapped in an aggregate exception, but I can understand the argument for cleaning it up a little.

@AnthonyLloyd
Copy link
Contributor

I think this does simply for single exceptions. Will accept.

@0x53A
Copy link
Contributor Author

0x53A commented Aug 3, 2018

@adamchester for reference, the above screenshot was from this source code:

                Runner.FocusedTestCase("focused async", async () => {
                    throw new IOException("Hello World!");
                }),

the TPL automatically wraps everything into aggregate exceptions, which is slightly annoying.

@adamchester
Copy link
Contributor

👍

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 a pull request may close this issue.

3 participants