Skip to content

Batch Debugger.ScriptParsed events sent from the debug extension #1628

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

Conversation

annagrin
Copy link
Contributor

@annagrin annagrin commented May 27, 2022

Batch Debugger.ScriptParsed events sent from the debug extension to extension backend.

  • batch extension events with method Debugger.ScriptParsed and send the batches every second to the server.
  • add tests verifying that the extension backend receives the Debugger.ScriptParsed events
  • fix flakes in debug_extension_tests and enable previously disabled tests

Note: We introduced sending Debugger.ScriptParsed events to fix the issue #1557, this PR is a follow up making the solution faster.

Closes: #1599

Related: #1621
Related: #1613

@@ -61,7 +62,10 @@ Tab _mostRecentDartTab;
DebuggerTrigger _debuggerTrigger;

class DebugSession {
final SocketClient socketClient;
// How often to send batched events.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: private fields should be listed after public ones

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks!

// TODO(grouma): switch back to `fixture.webdriver.title` when
// https://github.com/flutter/devtools/issues/2045 is fixed.
expect(await context.webDriver.pageSource, contains('Flutter'));
expect(await context.webDriver.title, contains('Dart DevTools'));
Copy link
Contributor

Choose a reason for hiding this comment

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

This changes seem unrelated to this PR / the tests are still disabled. I think these changes should be made in a separate PR as part of re-enabling the tests.

Copy link
Contributor Author

@annagrin annagrin May 31, 2022

Choose a reason for hiding this comment

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

Agreed, will revert. I am concerned about those tests being disabled for too long though - we might break launching devtools inadvertently... We can use the same waiting for the devtools to launch technique as used in the debug_extension_tests to make the tests not flaky.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@annagrin annagrin requested a review from elliette May 31, 2022 23:40
@@ -3,7 +3,9 @@
- Update `package:vm_service` to 8.3.0.
- Convert JavaScript stack traces in uncaught exceptions to Dart stack traces.
- Fix failure to set breakpoints on windows with a base change in index.html.

Copy link
Contributor

Choose a reason for hiding this comment

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

One more nit: Looks like the DWDS change is actually just moving batched_stream.dart into shared utilities. Let's update CHANGELOG to reflect that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Copy link
Contributor

@elliette elliette left a comment

Choose a reason for hiding this comment

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

One requested change then LGTM

Anna Gringauze added 2 commits May 31, 2022 17:11
Update change log to reflect moving `batched_stream.dart` into shared utilities.
@annagrin annagrin merged commit 0e77cae into dart-lang:master Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Batch script parsed events from the debug extension.
2 participants