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

Integration tests don't finish on failure #11

Closed
2 tasks done
HugoCSWork opened this issue Oct 25, 2023 · 6 comments
Closed
2 tasks done

Integration tests don't finish on failure #11

HugoCSWork opened this issue Oct 25, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@HugoCSWork
Copy link

Describe the bug

Currently if you run integration tests with catcher 2 wrapped around the application on a failure the tests don't finish but just get stuck. This was not occurring on the original catcher. I have created a demo project to demonstrate the issue.

To Reproduce

Steps to reproduce the behavior:

  1. Clone https://github.com/HugoCSWork/catcher_2_integration_test_bug
  2. run the integration test flutter test integration_test/main_test.dart
  3. Test will fail as expected but will cause the integration tests to get stuck

Expected behavior

Test will complete in terminal showing one integration test failure

Device

  • OS: MacOS and Linux
  • catcher_2 version: 1.0.0

Checklist

  • I have read and followed the entire README and it has not provided the solution I need.
  • I have provided all the information I can (incl. auth URL etc.)
@HugoCSWork HugoCSWork added the bug Something isn't working label Oct 25, 2023
@HugoCSWork HugoCSWork changed the title Integration tests don't finish on faiilure Integration tests don't finish on failure Oct 25, 2023
@ThexXTURBOXx
Copy link
Owner

Thanks for the MRE! I will take a look at it in a few hours when I am home.
I suspsect that this might be very related to #10 and I fear that some internal changes inside Flutter's runApp function are the real culprit in both cases.
In the mean time, can you observe the same behaviour in Flutter 3.13.7 or even older (like 3.13.0 and 3.10.7 or something?)

@HugoCSWork
Copy link
Author

Thanks for the quick response! I've done some quick testing with FVM using version 3.13.7 and 3.10.7 but am still experiencing the same issue.

When using the previous catcher it was on flutter version 3.7.8 but that is incompatible with catcher 2.

@ThexXTURBOXx
Copy link
Owner

Alright, thanks for the testing and reporting back! I will see what I can do then. Catcher 2 has only very few internal changes to Catcher, so it will most likely be some change between Flutter 3.7.x and Flutter 3.10.x. Maybe, I will find something suspicious.

@ThexXTURBOXx
Copy link
Owner

ThexXTURBOXx commented Oct 26, 2023

I was not able to reproduce this exact issue, because I had another one.
Please see whether the test fails properly on your machine in HugoCSWork/catcher_2_integration_test_bug#1

I have added two parameters to Catcher2Options which can be used to define additional behaviour that should be executed when an error is caught by this package.
Integration tests rely on a specific onError behaviour which can be inherited this way.
Maybe, it would also be nice to have another parameter which can be used to indicate that the current value of onError should be used.

@ThexXTURBOXx
Copy link
Owner

The fix should now be available as part of version 1.0.1

@HugoCSWork
Copy link
Author

Thank you for getting this sorted so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants