Skip to content

[flutter_tool] Kill a timing-out process before trying to drain its streams - #40159

Merged
zanderso merged 1 commit into
flutter:masterfrom
zanderso:process-timeout-fix
Sep 11, 2019
Merged

zanderso merged 1 commit into
flutter:masterfrom
zanderso:process-timeout-fix

Conversation

@zanderso

@zanderso zanderso commented Sep 10, 2019 •

Copy link
Copy Markdown
Member

Description

This PR fixes a test of subprocess timeout behavior such that its stdout and stderr streams won't be completed until the subprocess is killed. The corrected test required that runAsync() be fixed to kill a subprocess before trying to drain its output streams. I also made runAsync() only try to drain the output streams of a killed process for a second or so to handle the case where the attempt to kill the subprocess is unsuccessful for some reason.

Related Issues

#35988

Tests

I added the following tests:

Updates to process_test.dart

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read [Handling breaking changes]). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@zanderso zanderso added the tool Affects the "flutter" command-line tool. See also t: labels. label Sep 10, 2019
@codecov

codecov Bot commented Sep 10, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #40159 into master will decrease coverage by 0.45%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #40159      +/-   ##
==========================================
- Coverage   58.51%   58.06%   -0.46%     
==========================================
  Files         192      192              
  Lines       18426    18416      -10     
==========================================
- Hits        10782    10693      -89     
- Misses       7644     7723      +79
Flag Coverage Δ
#flutter_tool 58.06% <100%> (-0.46%) ⬇️
Impacted Files Coverage Δ
packages/flutter_tools/lib/src/base/process.dart 83.43% <100%> (-1.08%) ⬇️
...flutter_tools/lib/src/android/android_console.dart 0% <0%> (-96.3%) ⬇️
...ckages/flutter_tools/lib/src/base/fingerprint.dart 54.66% <0%> (-40%) ⬇️
packages/flutter_tools/lib/src/cache.dart 22.46% <0%> (-21.77%) ⬇️
.../flutter_tools/lib/src/android/android_device.dart 15.75% <0%> (-18.25%) ⬇️
packages/flutter_tools/lib/src/device.dart 55.88% <0%> (-2.36%) ⬇️
packages/flutter_tools/lib/src/version.dart 90.9% <0%> (-1.92%) ⬇️
...ges/flutter_tools/lib/src/android/android_sdk.dart 77.15% <0%> (-0.75%) ⬇️
...utter_tools/lib/src/build_runner/build_runner.dart 0% <0%> (ø) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 03e8100...9c610be. Read the comment docs.

@jonahwilliams jonahwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@tvolkert tvolkert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@zanderso
zanderso merged commit 2c94f2b into flutter:master Sep 11, 2019
@zanderso
zanderso deleted the process-timeout-fix branch September 11, 2019 15:30
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Sep 30, 2019
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants