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

assert: EventuallyWithT must catch panics in condition such as CollectT.FailNow #1457

Open
dolmen opened this issue Aug 11, 2023 · 2 comments · May be fixed by #1481
Open

assert: EventuallyWithT must catch panics in condition such as CollectT.FailNow #1457

dolmen opened this issue Aug 11, 2023 · 2 comments · May be fixed by #1481
Labels
assert.Eventually About assert.Eventually/EventuallyWithT bug pkg-assert Change related to package testify/assert

Comments

@dolmen
Copy link
Collaborator

dolmen commented Aug 11, 2023

In EventuallyWithT the condition function may call CollectT.FailNow which panics.

The implementation of EventuallyWithT should catch this panic (as well as any other panic in the condition).

@dolmen
Copy link
Collaborator Author

dolmen commented Aug 11, 2023

@dolmen dolmen added bug pkg-assert Change related to package testify/assert assert.Eventually About assert.Eventually/EventuallyWithT labels Aug 11, 2023
@dolmen
Copy link
Collaborator Author

dolmen commented Aug 11, 2023

CollectT.FailNow is required to be able to use functions from package require. I think we should use a sentinel value in the panic to handle that panic specifically.

michaeldwan added a commit to superfly/flyctl that referenced this issue Aug 29, 2023
It seems that some assertions will call `FailNow()` which panics when called on `assert.CollectT`.

See:
- stretchr/testify#1396
- stretchr/testify#1457
michaeldwan added a commit to superfly/flyctl that referenced this issue Aug 29, 2023
It seems that some assertions will call `FailNow()` which panics when called on `assert.CollectT`.

See:
- stretchr/testify#1396
- stretchr/testify#1457
marshall-lee added a commit to marshall-lee/testify that referenced this issue Oct 8, 2023
@marshall-lee marshall-lee linked a pull request Oct 8, 2023 that will close this issue
marshall-lee added a commit to marshall-lee/testify that referenced this issue Oct 13, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Oct 16, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Oct 16, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Oct 16, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Oct 16, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
marshall-lee added a commit to marshall-lee/testify that referenced this issue Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert.Eventually About assert.Eventually/EventuallyWithT bug pkg-assert Change related to package testify/assert
Projects
None yet
1 participant