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

Report assert errors as t.Error #628

Merged
merged 1 commit into from
Nov 7, 2023
Merged

Report assert errors as t.Error #628

merged 1 commit into from
Nov 7, 2023

Conversation

emcfarlane
Copy link
Contributor

Internal assert package returns booleans for allowing conditional behaviour but currently can't be used as t.Fatal is called suspending execution. It's also not safe for t.Fatal to be called outside of the main go routine running the test. Use t.Error to report errors instead.

Example:

assert.NotZero(a.tb, req.Peer().Addr)
under failure would panic the client or server go routines not the test handlers.

@emcfarlane emcfarlane self-assigned this Nov 6, 2023
@jhump jhump merged commit 20b5723 into main Nov 7, 2023
8 checks passed
@jhump jhump deleted the ed/assert-error branch November 7, 2023 13:18
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.

None yet

3 participants