You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'll fail and quit. We essentially run flutter attach --machine -d macos --debug-uri http://127.0.0.1:52407/HASY0oHZsH0=/ which will fail in the same way from the terminal.
It seems to be because we're using flutter attach. I suspect either that's changed, or in the past we would use the VM directly for attaching to tests.
As a workaround, you can use cwd to prevent detecting it's a Flutter project and attaching with Dart:
I think this actually became broken by DDS changes, though I'm not sure whether the old behaviour was an intended workflow or just accidentally worked.
This is (mostly) what happens if you were to run Debug: Attach to Dart Process in VS Code. We detect the project is Flutter, so we use flutter attach (at the time of attaching, we do not know if it's a test or a real Flutter app, so we have to use flutter attach since it may be an app and attaching just as a Dart app would lose some Flutter functionality).
The same steps do not work on master. When you try to attach in the same way, you see (if running in verbose mode):
[ +50 ms] Warning: Failed to start DDS: A DDS instance is already connected at http://127.0.0.1:54815/HfD3aZOVCDc=/.
[ ] Fail to connect to service protocol: http://127.0.0.1:54815/HfD3aZOVCDc=/: DartDevelopmentServiceException: A DDS instance is already connected at
http://127.0.0.1:54815/HfD3aZOVCDc=/.
[ +3 ms] Error connecting to the service protocol: failed to connect to http://127.0.0.1:54815/HfD3aZOVCDc=/
[ +11 ms] "flutter attach" took 498ms.
Is this expected to work? It was hit by @terrylucas recently.
That shouldn't be a fatal error since the VM service will redirect a client to connect to an existing DDS instance if there is one. However, in the attach case we don't know if DDS is running or not so we just try to spin it up and connect. If DDS is already running, there's no issue continuing with the attach.
Does that mean this is a bug somewhere? It's causing the tool to quit right now - though I'm not sure if that's because Flutter isn't handling it correctly, or something in the VM/DDS? Here's the full stack from the error:
Activity
DanTup commentedon Nov 18, 2020
I think this actually became broken by DDS changes, though I'm not sure whether the old behaviour was an intended workflow or just accidentally worked.
@jonahwilliams @bkonyi on current stable, if I start tests paused using:
I can then attach to them with
flutter attach:This is (mostly) what happens if you were to run
Debug: Attach to Dart Processin VS Code. We detect the project is Flutter, so we useflutter attach(at the time of attaching, we do not know if it's a test or a real Flutter app, so we have to useflutter attachsince it may be an app and attaching just as a Dart app would lose some Flutter functionality).The same steps do not work on master. When you try to attach in the same way, you see (if running in verbose mode):
Is this expected to work? It was hit by @terrylucas recently.
bkonyi commentedon Nov 18, 2020
That shouldn't be a fatal error since the VM service will redirect a client to connect to an existing DDS instance if there is one. However, in the
attachcase we don't know if DDS is running or not so we just try to spin it up and connect. If DDS is already running, there's no issue continuing with theattach.DanTup commentedon Nov 18, 2020
Does that mean this is a bug somewhere? It's causing the tool to quit right now - though I'm not sure if that's because Flutter isn't handling it correctly, or something in the VM/DDS? Here's the full stack from the error:
bkonyi commentedon Nov 18, 2020
Yeah, looks like it's not being handled correctly. I'll take a look.
DanTup commentedon Nov 18, 2020
Thanks! (LMK if you want e to file an SDK bug for it)
DanTup commentedon Dec 7, 2020
Fixed by flutter/flutter#70847.