Skip to content

Hang on success in analyze.dart #117659

@gnprice

Description

@gnprice

Details

When locally running analysis on the Flutter tree, after printing a success message the command hangs for a long time.

For example:

$ time dart --enable-asserts dev/bots/analyze.dart 
▌10:30:39▐ STARTING ANALYSIS 
▌10:30:39▐ No Double.clamp 
[…]
▌10:32:49▐ Correct file names in gen_defaults.dart... 
▌10:32:49▐ Analysis successful. 
^C

time: 332.757s wall (34.625s u, 5.508s s)
Full command output
$ time dart --enable-asserts dev/bots/analyze.dart 
▌10:30:39▐ STARTING ANALYSIS 
▌10:30:39▐ No Double.clamp 
▌10:30:41▐ All tool test files end in _test.dart... 
▌10:30:41▐ No sync*/async* 
▌10:30:42▐ No runtimeType in toString... 
▌10:30:42▐ Debug mode instead of checked mode... 
▌10:30:42▐ Links for creating GitHub issues 
▌10:30:43▐ Unexpected binaries... 
▌10:30:43▐ Trailing spaces... 
▌10:30:44▐ Deprecations... 
▌10:30:45▐ Goldens... 
▌10:30:45▐ Skip test comments... 
▌10:30:47▐ Licenses... 
▌10:30:51▐ Test imports... 
▌10:30:52▐ Bad imports (framework)... 
▌10:30:52▐ Bad imports (tools)... 
▌10:30:52▐ Internationalization... 
▌10:30:53▐ Integration test timeouts... 
▌10:30:53▐ null initialized debug fields... 
▌10:30:53▐ Taboo words... 
▌10:30:54▐ Package dependencies... 
▌10:30:54▐ Package Allowlist... 
▌10:30:57▐ Dart analysis... 
▌10:32:21▐ Executable allowlist... 
▌10:32:21▐ Dart analysis (with --watch)... 
▌10:32:33▐ Snippet code... 
▌10:32:42▐ Dart analysis (mega gallery)... 
▌10:32:49▐ Correct file names in gen_defaults.dart... 
▌10:32:49▐ Analysis successful. 
^C

time: 332.757s wall (34.625s u, 5.508s s)

Here the timestamps together with the time output show the command had printed "Analysis successful." and then been hanging for about 3 minutes after that before I hit Ctrl+C to kill it.

This doesn't occur if the analysis fails; in that case it exits promptly after printing "Test failed."

Target Platform: Linux
Target OS version/browser: Debian 10
Devices: n/a

Diagnosis

On investigation, this turns out to be due to the output-suppression timer introduced in #109206 as part of cleaning up the test output. This also explains why the issue doesn't affect CI, because that output-suppression feature isn't active in CI.

I have a fix, which I'll send as a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: contributor-productivityTeam-specific productivity, code health, technical debt.c: performanceRelates to speed or footprint issues (see "perf:" labels)toolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions