Content-Length: 304265 | pFad | https://github.com/flutter/flutter/issues/158875

74 Tools integration tests should always stream output · Issue #158875 · flutter/flutter · GitHub
Skip to content

Tools integration tests should always stream output #158875

@matanlurey

Description

@matanlurey

There are 200 instances in 53 files where tests in flutter_tools uses processManager.run, or some variant of that command, which runs an external process, effectively blocks (sometimes using async, but still halts execution from a test perspective), and then, upon completion, checks if the result was successful.

For example, something like this:

test('flutter does great things', () async {
  ProcessResult result = processManager.run(flutterBin, ['create', 'foo']);
  expect(result, const ProcessResultMatcher());

  result = processManager.run(flutterBin, ['build', 'apk']);
  expect(result, const ProcessResultMatcher());
});

There is an inherit problem with this pattern and timeouts. The flutter_tools package insists that no test take longer than 15 minutes, and there are overall timeout commitments at the LUCI and CI level (often between 30m and 60m).

In practical terms, that means that if any processManager.run goes over either a test or task timeout, the output will appear befuddlingly incomplete, and it will be unclear from a triage perspective if the test shard needs re-sharding, the particular test is just taking too long, or if there is an underlying failure, such as a OOM or crash which does not cause the process to complete as expected.

One such example is #158560:

15:26 +87: test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart: (setUpAll)
15:26 +87: test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart: flutter build "linux" succeeds without libraries
15:51 +88: test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart: flutter build "apk" succeeds without libraries
30:54 +88 -1: test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart: flutter build "apk" succeeds without libraries [E]
  TimeoutException after 0:15:00.000000: Test timed out after 15 minutes.
  dart:isolate  _RawReceivePort._handleMessage

... there is no way to know what flutter build apk was doing (was it making progress? did it crash?).

I made a 1-off adjustment in #158757, but I'd suggest:

  • Integration tests in the tool should always stream process output
  • There should be a top-level function for doing so, that does it the right way
  • A test should assert that integration tests do not call processManager.run directly

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.team-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/flutter/flutter/issues/158875

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy