Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[flutter_tools] Test that DAP process terminates at the end of a session #108301

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

Merged
merged 1 commit into from
Aug 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ void main() {
'',
startsWith('Exited'),
]);

// If we're running with an out-of-process debug adapter, ensure that its
// own process shuts down after we terminated.
final DapTestServer server = dap.server;
if (server is OutOfProcessDapTestServer) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the concrete class of server sometimes be something else when this test is run?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can run the tests with an env variable to un them in-process which is useful for debugging (it's faster, you can step through the code, and you don't need to rebuild flutter_tools):

final bool useInProcessDap = Platform.environment['DAP_TEST_INTERNAL'] == 'true';

However in that case, there is no process (it only exists on OutOfProcessDapTestServer).

await server.exitCode;
}
});

testWithoutContext('outputs useful message on invalid DAP protocol messages', () async {
Expand Down