Skip to content
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

Added a DartExecutor API for querying # of pending channel callbacks #10021

Merged
merged 3 commits into from
Jul 23, 2019

Conversation

adazh
Copy link
Contributor

@adazh adazh commented Jul 23, 2019

This API will be used for monitoring the # of pending callbacks that shall be invoked by the platform in Espresso.

Relevant PR for monitoring the Dart land: flutter/flutter#36599.

@adazh
Copy link
Contributor Author

adazh commented Jul 23, 2019

cc @tvolkert

@adazh adazh changed the title Added an DartExecutor API for querying # of pending channel callbacks Added a DartExecutor API for querying # of pending channel callbacks Jul 23, 2019
/**
* Returns the number of pending platform channel callback replies.
*/
public int getNumOfPendingChannelCallbacks() {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about we call these methods getPendingChannelResponseCount()? Generally in Flutter we avoid truncating terms, and also it might be clearer to refer to them as "responses" because they are responding to messages.

Also, in the javadocs can you elaborate on what this means? Currently the javadoc repeats the terms in the name of the method. If a developer doesn't already know what the method represents, then that developer would probably like to know that:

  • every channel message from Android to Flutter will receive a response, even if its empty
  • Flutter tracks the number of responses its waiting for
  • this method returns that number
  • this method is useful for determining whether or not Flutter is idle

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. PTAL.

* possibly capture an indeterministic internal state, and is strongly discouraged.
*
* <p>Currently, it's mainly useful for a testing framework like Espresso to determine whether all
* the async channel callbacks are properly handled and the app is idle.
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, does this ensure they are "properly handled"? or just that it's idle?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed "properly". I feel it's too vague to simply say "it's idle", because usually it doesn't equal completely idle. Rather, it's a state we define as idle.

Copy link
Contributor

@matthew-carroll matthew-carroll left a comment

Choose a reason for hiding this comment

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

LGTM, pending a few more adjustments. Thanks.

@adazh
Copy link
Contributor Author

adazh commented Jul 23, 2019

Checked the failing tests, and it doesn't seem relevant to this PR. I'm going to ignore them and submit the code.

@adazh adazh merged commit ef99738 into flutter:master Jul 23, 2019
@adazh adazh deleted the pending_message_channel branch July 23, 2019 20:11
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 23, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Jul 24, 2019
flutter/engine@8ed5da8...ef99738

git log 8ed5da8..ef99738 --no-merges --oneline
ef99738 Added a DartExecutor API for querying # of pending channel callbacks (flutter/engine#10021)
a0ec528 Embedding testing app (flutter/engine#10007)
2bf1506 Disable DartLifecycleTest::ShuttingDownTheVMShutsDownAllIsolates in runtime_unittests. (flutter/engine#10064)
8edd257 Roll fuchsia/sdk/core/linux-amd64 from M5an7VPM8DiCcNcKe6J0CkAtLk8X9oMeJUqGOrZATIsC to XqtWTBni4xpYCTr7gqU7rFTuXNY1TZ_zOqBJrZM8c_kC (flutter/engine#10061)
e32bdf5 Roll src/third_party/skia 00c680d2bb7c..e11dfd3da4d7 (18 commits) (flutter/engine#10062)
6603dbd Update .cirrus.yml (flutter/engine#10056)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
johnsonmh pushed a commit to johnsonmh/flutter that referenced this pull request Jul 30, 2019
flutter/engine@8ed5da8...ef99738

git log 8ed5da8..ef99738 --no-merges --oneline
ef99738 Added a DartExecutor API for querying # of pending channel callbacks (flutter/engine#10021)
a0ec528 Embedding testing app (flutter/engine#10007)
2bf1506 Disable DartLifecycleTest::ShuttingDownTheVMShutsDownAllIsolates in runtime_unittests. (flutter/engine#10064)
8edd257 Roll fuchsia/sdk/core/linux-amd64 from M5an7VPM8DiCcNcKe6J0CkAtLk8X9oMeJUqGOrZATIsC to XqtWTBni4xpYCTr7gqU7rFTuXNY1TZ_zOqBJrZM8c_kC (flutter/engine#10061)
e32bdf5 Roll src/third_party/skia 00c680d2bb7c..e11dfd3da4d7 (18 commits) (flutter/engine#10062)
6603dbd Update .cirrus.yml (flutter/engine#10056)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
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.

3 participants