-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Run flutter tests in preview-dart-2 mode on travis flutter builds. #14728
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
Conversation
|
The changes look good but I am not sure why you are getting test errors in all the shards. Maybe you should sync up and try the tests again to see what state they end up in. |
.travis.yml
Outdated
| - os: osx | ||
| env: SHARD=docs | ||
| - os: osx | ||
| env: SHARD=tests_dart2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this excludes it from osx. i think we want it enabled for osx, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was not sure we want to run them on osx, but enabled now.
dev/bots/test.dart
Outdated
| await _pubRunTest(path.join(flutterRoot, 'packages', 'flutter_tools')); | ||
| await _pubRunTest(path.join(flutterRoot, 'dev', 'bots')); | ||
|
|
||
| await _runAllDartTests(path.join(flutterRoot, 'dev', 'devicelab')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we run dart tests with preview2 too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that should be possible.
| await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'), options: options); | ||
| await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'), options: options); | ||
| await _pubRunTest(path.join(flutterRoot, 'packages', 'flutter_tools')); | ||
| await _pubRunTest(path.join(flutterRoot, 'dev', 'bots')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how pub run can run in dart2 mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to file an issue against pub for this.
Currently it has the following options for pub run
Usage: pub run [args...]
-h, --help Print this usage information.
-c, --[no-]checked Enable runtime type checks and assertions.
--mode Mode to run transformers in.
(defaults to "release" for dependencies, "debug" for entrypoint)
it needs another option here '--preview-dart-2' to be consistent that would run in dart2 mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened dart-lang/sdk#32214
|
Maybe we should move running under dart2 mode to the Allowed Failure section so that we can land this PR and then fix up the tests. |
I would have been happy to do that, but I'm seeing some weird timeout issues with running dart2 tests all at once. It looks like machine performance tanks when you run ~30 frontend tests in parallel(15 tests work). |
Limiting concurrency to 4 seems to work fine. |
|
I think we need to investigate reusing a single frontend_server instance for running multiple tests. Spawning a new one per test is likely way too much overhead. |
|
FYI: |
Actually use single compiler to incrementally recompile all tests executed by 'flutter test'.
| bool isEmpty = compilationQueue.isEmpty; | ||
| compilationQueue.add(request); | ||
| // Only trigger processing if queue was empty - i.e. no other requests | ||
| // we being processed. This effectively enforces "one compilation request at a time". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no other requests are currently being processed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Done.
| compiler.accept(); | ||
| compiler.reset(); | ||
| request.result.complete(outputPath); | ||
| // Only remove now when we finished processing the element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in what circumstance would we try recompiling the same test again ? I am wondering why is is necessary to remove the request only after we are done with the compilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not that we are going to recompile the same test again. We only remove the test from the queue after we are done compiling because that way we know that no other compilation request can start before we exit(no await statements from this point on).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok got it.
|
What is the final outcome of this, do we run the Travis tests using the batch compiler? I thought this would cause timeouts as we would exceed the Travis time budgets. |
Correct, this is now blocked on incremental compiler issue revealed in #14931. |
|
Blocked on dart-lang/sdk#32368 |
|
With dart-lang/sdk#32368 fixed, this PR that shares frontend server between tests travis build in preview-dart-2 takes 26m47s, "only" 20s more than non-preview-dart-2 test, so is ready to be submitted I believe. |
|
It looks more like 3 minutes slower on Mac, but 8 minutes slower on Linux if I am not misreading the output. I think this warrants investigation, to see if we can do something about it /cc @jensjoha @kmillikin |
|
as @Hixie pointed out comparing numbers from
|
|
Looks like this broke internal Google tests - /cc @keertip |
|
And looks like @jason-simmons already has a fix internally |
|
For now I have a few comments:
After fixing whats talked about in bullet-point #1 above I get
|
…lutter#14728) * Run flutter tests in preview-dart-2 mode on travis flutter builds. * Run dart2 tests on osx. Run dart tests in dart2. * Fix name camelCase * Default options to empty array, rather than null * Troubleshoot failures * More logging * Troubleshoot: run single test * Troubleshoot: run 15 tests * Troubleshoot: run 15 tests with fix * Try limit concurrency to 1 * Limit concurrency for preview-dart-2 tests to 4 * Move dart2 tests to allow_failures section * Reinstate tests_dart_2 shard * Raise concurrency to 8 * Reuse compiler across multiple test runs * Allow to switch entry points when recompiling. Actually use single compiler to incrementally recompile all tests executed by 'flutter test'. * Remove leftover commented code * Fix comment * Lints

cc: @a-siva