-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Moving this from discussion at flutter/flutter#147250 as the issue here is in the base debug adapter.
When trying to roll the latest DDS (with DAP) into Flutter, some tests are timing out. This starts happening with 717aa63.
With the changes above, we can all output for stack frames (to linkify them). This may involve async work if we need to resolve package:foo to a file path (done by calling lookupResolvedPackageUris). Output events are queued to ensure output always arrives in the correct order and when we're shutting down, we wait for the output queue to drain (so that you don't miss potentially-important output - such as exception details - if the application terminates).
For reasons I don't understand, the call to lookupResolvedPackageUris never completes in some (most) cases when running those tests. I would have thought it would throw (possibly "The client closed with pending request"?).
The flutter test process exits anyway, and as part of our shutdown we then wait for all output events to drain - but this never happens because they're queued behind an output event that's stalled on lookupResolvedPackageUris.
One possible fix is to say that we never wait for more than x seconds for output events during shutdown. This would ensure we always terminate if the target process is gone, no matter what's happening with output events. However, it would be better if we could ensure lookupResolvedPackageUris just terminated during shutdown instead, because there is error handling that would then allow the output events to still be sent (without any linkifying).
@bkonyi any ideas why the request wouldn't be failing given that the target process has exited? (is it possibly because we're connected to DDS and not to the target process? Does it handle this?)