Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1288)

Issue 11091070: Change Process.start to return a future that completes with a (Closed)

Created:
8 years, 2 months ago by Mads Ager (google)
Modified:
8 years, 2 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Change Process.start to return a future that completes with a Process object only when the process has been successfully started. This is less error prone since you can use all the methods on a Process object as soon as you can get your hands on it. Unfortunately, this change leads to quite a few changes in test.dart. Some of those changes will fix bugs as well. We used to have a problem with a timeout that could fire just in between two steps in a chain of commands that constitute one test run. This change should address that issue as well. BUG=dartbug.com/5305 Committed: https://code.google.com/p/dart/source/detail?r=13729

Patch Set 1 #

Total comments: 35

Patch Set 2 : Address review comments. #

Total comments: 5

Patch Set 3 : Restructure to get rid of _onStart and _onError #

Unified diffs Side-by-side diffs Delta from patch set Stats (+567 lines, -586 lines) Patch
M lib/compiler/implementation/lib/io.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M runtime/bin/process.dart View 1 3 chunks +11 lines, -27 lines 0 comments Download
M runtime/bin/process_impl.dart View 1 2 9 chunks +115 lines, -133 lines 0 comments Download
M runtime/bin/process_win.cc View 1 1 chunk +1 line, -4 lines 0 comments Download
M tests/standalone/io/dart_std_io_pipe_test.dart View 1 1 chunk +29 lines, -29 lines 0 comments Download
M tests/standalone/io/process_broken_pipe_test.dart View 1 chunk +11 lines, -10 lines 0 comments Download
M tests/standalone/io/process_check_arguments_test.dart View 1 chunk +7 lines, -6 lines 0 comments Download
M tests/standalone/io/process_exit_test.dart View 1 chunk +8 lines, -7 lines 0 comments Download
D tests/standalone/io/process_kill_unstarted_test.dart View 1 chunk +0 lines, -15 lines 0 comments Download
M tests/standalone/io/process_segfault_test.dart View 1 chunk +8 lines, -7 lines 0 comments Download
M tests/standalone/io/process_start_exception_test.dart View 1 chunk +8 lines, -10 lines 0 comments Download
M tests/standalone/io/process_stderr_test.dart View 2 chunks +7 lines, -7 lines 0 comments Download
M tests/standalone/io/process_stdout_test.dart View 2 chunks +7 lines, -8 lines 0 comments Download
M tests/standalone/io/process_working_directory_test.dart View 1 2 chunks +21 lines, -22 lines 0 comments Download
M tools/testing/dart/co19_test.dart View 2 chunks +2 lines, -6 lines 0 comments Download
M tools/testing/dart/test_runner.dart View 1 7 chunks +90 lines, -64 lines 0 comments Download
M tools/testing/dart/test_suite.dart View 1 1 chunk +28 lines, -23 lines 0 comments Download
M utils/pub/io.dart View 1 2 chunks +47 lines, -45 lines 0 comments Download
M utils/testrunner/layout_test_controller.dart View 1 1 chunk +143 lines, -140 lines 0 comments Download
M utils/testrunner/pipeline_utils.dart View 1 1 chunk +21 lines, -20 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
Mads Ager (google)
Sorry for the long list of reviewers. Søren and Rico, could you review the dart:io ...
8 years, 2 months ago (2012-10-11 16:00:53 UTC) #1
gram
The changes in tools/testing/dart and utils/testrunner look good to me. There is a slight chance ...
8 years, 2 months ago (2012-10-11 16:50:28 UTC) #2
ricow1
http://codereview.chromium.org/11091070/diff/1/tests/standalone/io/dart_std_io_pipe_test.dart File tests/standalone/io/dart_std_io_pipe_test.dart (right): http://codereview.chromium.org/11091070/diff/1/tests/standalone/io/dart_std_io_pipe_test.dart#newcode73 tests/standalone/io/dart_std_io_pipe_test.dart:73: Expect.fail(error.toString()); we should probably do a dir.deleteRecursivelySync() in here ...
8 years, 2 months ago (2012-10-11 17:27:34 UTC) #3
Emily Fortuna
lgtm after the comments are addressed http://codereview.chromium.org/11091070/diff/1/tools/testing/dart/test_runner.dart File tools/testing/dart/test_runner.dart (right): http://codereview.chromium.org/11091070/diff/1/tools/testing/dart/test_runner.dart#newcode681 tools/testing/dart/test_runner.dart:681: new StringInputStream(stdoutStream); consider: ...
8 years, 2 months ago (2012-10-11 18:23:07 UTC) #4
ahe
Changes to tools/testing/dart, LGTM! http://codereview.chromium.org/11091070/diff/1/tools/testing/dart/test_runner.dart File tools/testing/dart/test_runner.dart (right): http://codereview.chromium.org/11091070/diff/1/tools/testing/dart/test_runner.dart#newcode673 tools/testing/dart/test_runner.dart:673: Future processFuture = Process.start(command.executable, command.arguments); ...
8 years, 2 months ago (2012-10-11 18:39:50 UTC) #5
Søren Gjesse
LGTM, looks much cleaner http://codereview.chromium.org/11091070/diff/1/runtime/bin/process.dart File runtime/bin/process.dart (right): http://codereview.chromium.org/11091070/diff/1/runtime/bin/process.dart#newcode83 runtime/bin/process.dart:83: abstract void set onExit(void callback(int ...
8 years, 2 months ago (2012-10-12 07:47:21 UTC) #6
Mads Ager (google)
Thanks for all the comments! Rico and Søren, could you have another look. I removed ...
8 years, 2 months ago (2012-10-12 08:44:46 UTC) #7
Anders Johnsen
DBC, Thank you for doing this Mads, I'm sure it'll fix some issues for me ...
8 years, 2 months ago (2012-10-12 08:53:11 UTC) #8
Mads Ager (google)
http://codereview.chromium.org/11091070/diff/11002/runtime/bin/process_impl.dart File runtime/bin/process_impl.dart (right): http://codereview.chromium.org/11091070/diff/11002/runtime/bin/process_impl.dart#newcode247 runtime/bin/process_impl.dart:247: throw new ProcessException("Could not kill process"); On 2012/10/12 08:53:11, ...
8 years, 2 months ago (2012-10-12 08:56:25 UTC) #9
Anders Johnsen
http://codereview.chromium.org/11091070/diff/11002/runtime/bin/process_impl.dart File runtime/bin/process_impl.dart (right): http://codereview.chromium.org/11091070/diff/11002/runtime/bin/process_impl.dart#newcode247 runtime/bin/process_impl.dart:247: throw new ProcessException("Could not kill process"); On 2012/10/12 08:56:25, ...
8 years, 2 months ago (2012-10-12 08:58:10 UTC) #10
Søren Gjesse
LGTM! http://codereview.chromium.org/11091070/diff/11002/runtime/bin/process_impl.dart File runtime/bin/process_impl.dart (right): http://codereview.chromium.org/11091070/diff/11002/runtime/bin/process_impl.dart#newcode273 runtime/bin/process_impl.dart:273: void _reportError(e) { This is not used any ...
8 years, 2 months ago (2012-10-12 11:44:04 UTC) #11
Mads Ager (google)
http://codereview.chromium.org/11091070/diff/11002/runtime/bin/process_impl.dart File runtime/bin/process_impl.dart (right): http://codereview.chromium.org/11091070/diff/11002/runtime/bin/process_impl.dart#newcode273 runtime/bin/process_impl.dart:273: void _reportError(e) { On 2012/10/12 11:44:04, Søren Gjesse wrote: ...
8 years, 2 months ago (2012-10-12 11:50:26 UTC) #12
Mads Ager (google)
8 years, 2 months ago (2012-10-12 12:40:45 UTC) #13
On 2012/10/12 11:50:26, Mads Ager wrote:
>
http://codereview.chromium.org/11091070/diff/11002/runtime/bin/process_impl.dart
> File runtime/bin/process_impl.dart (right):
> 
>
http://codereview.chromium.org/11091070/diff/11002/runtime/bin/process_impl.d...
> runtime/bin/process_impl.dart:273: void _reportError(e) {
> On 2012/10/12 11:44:04, Søren Gjesse wrote:
> > This is not used any more - right?
> 
> It is still used internally to report startup errors. I'll see if I can
locally
> restructure to get rid of that. Thanks!

Restructured a bit so _onError and _onStart are gone from _Process as well.
Thanks!

Powered by Google App Engine
This is Rietveld 408576698