Skip to content

Linux analyzer_benchmark is 9.09% flaky #161306

Closed

Description

@fluttergithubbot

The post-submit test builder Linux analyzer_benchmark had a flaky ratio 9.09% for the past (up to) 100 commits, which is above our 2.00% threshold.

One recent flaky example for a same commit: https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20analyzer_benchmark/11268
Commit: b5df290

Flaky builds:
https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20analyzer_benchmark/11268
https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20analyzer_benchmark/11257

Recent test runs:
https://flutter-dashboard.appspot.com/#/build?taskFilter=Linux%20analyzer_benchmark

Please follow https://github.com/flutter/flutter/blob/master/docs/infra/Reducing-Test-Flakiness.md#fixing-flaky-tests to fix the flakiness and enable the test back after validating the fix (internal dashboard to validate: go/flutter_test_flakiness).

Activity

  1. added
    c: flakeTests that sometimes, but not always, incorrectly pass
    P0Critical issues such as a build break or regression
    team-toolOwned by Flutter Tool team
    on Jan 8, 2025
  2. matanlurey commented on Jan 9, 2025

    @matanlurey
    Contributor

    I'll take a look as Andrew is OOO (sick).

  3. self-assigned this
    on Jan 9, 2025
  4. zanderso commented on Jan 10, 2025

    @zanderso
    Member

    @jason-simmons from chat:

    It looks like the analyzer_benchmark is running on devicelab machines that do not have much memory.

    The analyzer_benchmark jobs are being placed on bots named flutter-devicelab-linux-[number].

    The "OS Info" section of the LUCI logs says that these machines only have 7.5GB of available RAM (barely more than the peak memory usage of the analyzer server)

    Can this benchmark be scheduled on some other worker pool?

    and

    I tried running bin/test_runner.dart test -t analyzer_benchmark locally on Linux.

    The benchmark is passing so far on my large Cloudtop instance.

    But the dart:analysis_server process peaks at a VmRSS of around 7GB before the benchmark completes.

    The script that runs the benchmarks is at https://github.com/flutter/flutter/blob/master/dev/devicelab/lib/tasks/analysis.dart.

    An interesting one is the mega_gallery benchmark that creates copies of the flutter_gallery until it reaches 64K lines of code, and then benchmarks the analysis time a few times. I suspect this is trying to simulate analysis times for a real large app.

    https://github.com/flutter/flutter/blob/master/dev/tools/mega_gallery.dart

    cc @jensjoha @mraleph

  5. jason-simmons commented on Jan 10, 2025

    @jason-simmons
    Member

    To execute the most memory intensive part of this benchmark, run:

    flutter analyze --benchmark --flutter-repo --ci
    

    Tried bisecting and found that there was a major regression in analysis server memory usage starting with https://dart.googlesource.com/sdk/+/d83aa005eee28233367a693bc83ba59e8504ba9f

    For the flutter analyze --flutter-repo command above, after that commit the peak VmRSS of the analysis server increases from ~4GB to ~7GB.

    @scheglov

  6. scheglov commented on Jan 10, 2025

    @scheglov
    Contributor

    This is sad. IIRC, the change on Golem for the analysis server analyzing itself was not so dramatic.
    Does it block you? I could try to look if it is feasible to restore this optimization.

  7. scheglov commented on Jan 11, 2025

    @scheglov
    Contributor

    https://dart-review.googlesource.com/c/sdk/+/403924 looks promising in Golem, about 4.2% less memory.
    Not a huge difference, but as I mentioned, it was not huge in that other CL too.

  8. jason-simmons commented on Jan 11, 2025

    @jason-simmons
    Member

    The https://dart-review.googlesource.com/c/sdk/+/403924 patch helps significantly.

    With that change, the peak memory usage of flutter analyze --flutter-repo is reduced to 4.6GB.

  9. scheglov commented on Jan 11, 2025

    @scheglov
    Contributor

    @jason-simmons That's great to hear! 4.6GB is a significant improvement. Apparently the effect on Flutter applications is much bigger than to applications that use smaller libraries. I'll get that patch landed once it is reviewed. Thanks for testing!

  10. mraleph commented on Jan 13, 2025

    @mraleph
    Member

    @srawlins @scheglov could somebody look into why Golem numbers don't directly align with Flutter numbers? I would like to make sure that Golem numbers are representative of the real world so that we could catch regressions like this.

  11. srawlins commented on Jan 13, 2025

    @srawlins
    Contributor

    I can try to look into this.

  12. mraleph commented on Jan 14, 2025

    @mraleph
    Member

    @srawlins

    I can try to look into this.

    I have chatted with @a-siva and we suspect that we have not caught this regression on Golem because flutter-analyzer target is broken by monorepo migration. AFAIK @aam is working on fixing Golem so maybe we don't actually have a problem with benchmarks, it's just that the Flutter benchmark was not running at that moment.

  13. aam commented on Jan 14, 2025

    @aam
    Member

    FlutterAnalyze on golem is back up and running, but it doesn't capture memory consumption, only runtime performance(which shows 3.56% runtime slowdown
    between [vm] Remove BaseIsolate as it serves no purposes anymore. and Elements. Add Element2.fragments - such a large gap due to failing runs due to monorepo).

  14. matanlurey commented on Jan 14, 2025

    @matanlurey
    Contributor
  15. github-actions commented on Jan 28, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  16. locked as resolved and limited conversation to collaborators on Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P0Critical issues such as a build break or regressionc: flakeTests that sometimes, but not always, incorrectly passdependency: dartDart team may need to help usteam-toolOwned by Flutter Tool teamtriaged-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