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

Issue 1604043003: Add support for a timeout flag. (Closed)

Created:
4 years, 11 months ago by nweiz
Modified:
4 years, 11 months ago
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/test@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : pubspec/changelog #

Total comments: 12

Patch Set 3 : Code review changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+288 lines, -31 lines) Patch
M CHANGELOG.md View 1 1 chunk +2 lines, -0 lines 0 comments Download
M lib/src/frontend/timeout.dart View 1 2 3 chunks +88 lines, -2 lines 0 comments Download
M lib/src/runner/configuration.dart View 6 chunks +21 lines, -7 lines 0 comments Download
M pubspec.yaml View 1 1 chunk +1 line, -1 line 0 comments Download
A test/frontend/timeout_test.dart View 1 chunk +85 lines, -0 lines 0 comments Download
M test/runner/runner_test.dart View 1 chunk +0 lines, -21 lines 0 comments Download
A test/runner/timeout_test.dart View 1 chunk +91 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
nweiz
4 years, 11 months ago (2016-01-19 23:07:01 UTC) #1
Lasse Reichstein Nielsen
lgtm https://codereview.chromium.org/1604043003/diff/20001/lib/src/frontend/timeout.dart File lib/src/frontend/timeout.dart (right): https://codereview.chromium.org/1604043003/diff/20001/lib/src/frontend/timeout.dart#newcode46 lib/src/frontend/timeout.dart:46: const Timeout(this.duration) Nothing here prevents you from passing ...
4 years, 11 months ago (2016-01-26 09:58:59 UTC) #3
nweiz
Code review changes
4 years, 11 months ago (2016-01-26 23:13:14 UTC) #4
nweiz
Committed patchset #3 (id:40001) manually as f610d7b17a4270a352be9f96e0c78839950e36a1 (presubmit successful).
4 years, 11 months ago (2016-01-26 23:13:46 UTC) #6
nweiz
4 years, 11 months ago (2016-01-26 23:15:40 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/1604043003/diff/20001/lib/src/frontend/timeou...
File lib/src/frontend/timeout.dart (right):

https://codereview.chromium.org/1604043003/diff/20001/lib/src/frontend/timeou...
lib/src/frontend/timeout.dart:46: const Timeout(this.duration)
On 2016/01/26 09:58:58, Lasse Reichstein Nielsen wrote:
> Nothing here prevents you from passing "null" as argument, creating an object
> that's like "none", but not identical to it.
> 
> I guess nothing can be done in a const constructor. Maybe this doesn't need to
> be a const constructor, and then you would be able to enforce that duration is
> non-null (until we get non-null types).

It needs to be const because it's used as an annotation.

https://codereview.chromium.org/1604043003/diff/20001/lib/src/frontend/timeou...
lib/src/frontend/timeout.dart:71: factory Timeout.parse(String timeout) {
On 2016/01/26 09:58:59, Lasse Reichstein Nielsen wrote:
> We generally make "parse" a static function, not a constructor
> (see DateTime, int, double, Uri).

This is true in the SDK, but externally pretty much all parse functions are
factory constructors (which I personally prefer since it means *all* APIs that
synchronously create an object from arguments are constructor-like).

https://codereview.chromium.org/1604043003/diff/20001/lib/src/frontend/timeou...
lib/src/frontend/timeout.dart:110: case "d": return number * 24 * 60 * 60 *
1000000;
On 2016/01/26 09:58:59, Lasse Reichstein Nielsen wrote:
> Maybe parenthesize (24 * 60 * 60 * 1000000).

I don't think that adds much.

https://codereview.chromium.org/1604043003/diff/20001/lib/src/frontend/timeou...
lib/src/frontend/timeout.dart:116: default: throw "Unknown unit $unit.";
On 2016/01/26 09:58:58, Lasse Reichstein Nielsen wrote:
> Consider making this an error instead of just a string.

Done.

https://codereview.chromium.org/1604043003/diff/20001/lib/src/frontend/timeou...
lib/src/frontend/timeout.dart:124: Timeout merge(Timeout other) {
On 2016/01/26 09:58:58, Lasse Reichstein Nielsen wrote:
> "merge" sounds symmetrical, but this seems like it applies "other" on top of
> "this" (with an other.scale applying to this.duration but an other.duration
> replacing this.scale).

I guess "compose" might be a more accurate name, but it's inherited from
Metadata.merge which is much more commonly used to merge unrelated metadata than
to compose different versions of the same sort.

> Also, the documentation doesn't say that either being none means that the
result
> is none (so "none is contagious" :)

Done.

https://codereview.chromium.org/1604043003/diff/20001/lib/src/frontend/timeou...
lib/src/frontend/timeout.dart:139: int get hashCode => duration.hashCode ^ 4 *
scaleFactor.hashCode;
On 2016/01/26 09:58:58, Lasse Reichstein Nielsen wrote:
> Any particular reason for the 4*? Consider something like 5* (or 31*) to keep
> some of the bits of the scale factor in the lower bits.

Done.

Powered by Google App Engine
This is Rietveld 408576698