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
build_test fails with an out-of-call-stack exception with build_resolvers 1.3.1 #2596
Comments
I tried just awaiting that – still has the problem! |
Awaiting that fixes the issue but then the test has to be updated to expect the new exception type (which is the documented one, previously it threw a different one). I think it might be breaking for other use cases though to await there, I need to look into it a bit more. cc @matanlurey |
Ya if we awaited there we would block on the I don't really know what the correct solution is going to be here. |
…async errors (#2599) Fixes #2596 Specifically if the `action` callback throws any exceptions then we would leak those as unhandled async errors. We can't await the call to `runBuilder` because that would block on the `tearDown` future which would hang tests. The solution is to just swallow all errors from the unawaited future, and rely on the `onDone` Future to report most errors. We try/catch the action callback and forward the errors to the `onDone` completer.
Reopening for more discussion. This change can cause some legitimate failures to get lost. When I drop the I'm not sure how much retaining these specific errors would help though. If the async error comes after the builder completes normally we'd still ignore those errors. build/build/lib/src/builder/logging.dart Line 28 in 2d36ee3
|
@natebosch should we close this at this point? |
I think #3253 and #3245 are examples of things that we can miss because of this design. I found both of those examples while I was experimenting with migrating those tests to I think this is still a likely issue when using I think that the complexity to solve this is not justified for continued safety with a library that has a foot-gun around async expectations. If we invest in async safety for |
build_resolvers: 1.3.1
build_test: 0.10.11
See commit b6fdcb0
This is the failing test:
https://github.com/kevmoo/source_gen_test/blob/c1aff801cba9f46c27a1da854fbeed75fb7b2a1e/test/init_library_reader_test.dart#L54-L62
The text was updated successfully, but these errors were encountered: