Skip to content

Conversation

@annagrin
Copy link
Contributor

@annagrin annagrin commented Jul 29, 2021

See: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#getstack

  • Throw SentinelException if the isolate id is unrecognized
    vm service protocol requires all isolate-related API to return Sentinel if the isolate
    had exited, which translates to throwing SentinelException in the implementation.
    Make dwds conform to that spec.

  • Throw RPCError if getStack is called when not paused
    vm service protocol requires getStack to always return a non-null value or a
    sentinel, but dwds is limited by chrome devtools API that do not curently give a
    way to get the stack while running. Throw RPC error to indicate that something
    unexpected has happened.

Helps: #1369

  • Update tests using expect on Futures to use expectLater instead.
    This makes sure the current test is finished before the next one starts, and
    reduces possibilities of flakes.
  • Fix race conditions in chrome_proxy_tests and enable skipped test
  • Update tests to expect errors on getStack called while running.

Closes: #721

Anna Gringauze added 2 commits July 28, 2021 17:43
- Throw SentiinelException if the isolate id is unrecognized
- Throw RPCError if getStack is called when not paused
- Fix race conditions in chrome_proxy_tests

Helps: dart-lang#1369
Closes: dart-lang#721
@google-cla google-cla bot added the cla: yes label Jul 29, 2021
@annagrin annagrin marked this pull request as draft July 29, 2021 15:45
annagrin pushed a commit to annagrin/flutter that referenced this pull request Jul 29, 2021
One case of recent CI flakes in web_tool_tests was caused by
a race condition between resuming an isolate and waiting for
the app to hit a next breakpoint. If resume gets delayed in
the vm service, the tests might get a stale "paused" state of
the isolate and call `getStack` while running, which causes
an exception in dwds, which is limited by chrome dev tools
capabilities in that case and cannot get a stack while running.

Fix the race condition by waiting for `Resume` event before
waiting for `Pause` in `TestDriver._resume`.

Following PR changes the null dereference to an RPCError
in dwds if `getStack` while the app is running.

Related: dart-lang/webdev#1370

Closes: dart-lang/webdev#1369
@annagrin annagrin requested a review from grouma July 29, 2021 16:13
@annagrin annagrin marked this pull request as ready for review July 29, 2021 16:13
@annagrin annagrin requested a review from bkonyi July 29, 2021 16:13
Copy link
Collaborator

@bkonyi bkonyi left a comment

Choose a reason for hiding this comment

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

LGTM with nits. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dwds test flakiness

2 participants