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

Tests re-raise exceptions that happen inside Widget.compose #4333

Merged
merged 4 commits into from
Mar 26, 2024
Merged

Conversation

rodrigogiraoserrao
Copy link
Contributor

@rodrigogiraoserrao rodrigogiraoserrao commented Mar 25, 2024

This will fix #4282.

The fix was to simply leverage the machinery introduced in #2754; for some reason, exceptions caught inside Widget.compose or workers were directly being sent to App.panic instead of using App._handle_exception.

This is probably an edge-case that wasn't covered in the original PR that introduced the machinery (namely App._exception and App._exception_event) that I want to leverage here.

Related PRs: #2754
tests/test_pilot.py Outdated Show resolved Hide resolved
@darrenburns
Copy link
Member

So this was nothing to do with the @work decorator in the end?

@rodrigogiraoserrao
Copy link
Contributor Author

So this was nothing to do with the @work decorator in the end?

It did... I had forgotten the original issue showed 2 apps.
In the end, the fix was the same though.
See 8c48a3b.

@rodrigogiraoserrao rodrigogiraoserrao marked this pull request as ready for review March 25, 2024 15:26
@willmcgugan
Copy link
Collaborator

Can we have a test where a worker throws an exception?

@willmcgugan
Copy link
Collaborator

NM I saw you do already! Seems to be failing on CI though.

@rodrigogiraoserrao
Copy link
Contributor Author

@willmcgugan CI is happy now.

@willmcgugan willmcgugan merged commit ff77cf7 into main Mar 26, 2024
20 checks passed
@willmcgugan willmcgugan deleted the fix-4282 branch March 26, 2024 11:09
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.

Exception not being raised in tests
3 participants