Skip to content

Gauge sometimes failed to parse the CPU percentage #45194

Closed

Description

@liyuqian

See this test run and this test run for examples.

The error log is like the following

Executing: pub global run gauge ioscpugpu new -w 9e4363d6960ef619aad7b987353075b5fdd4ad00 -l 10000 in /Users/flutter/.cocoon/flutter/dev/benchmarks/macrobenchmarks/build
2019-11-19T12:23:52.882340: Hostname: Platform.localHostname
stdout: Running instruments on iOS device 9e4363d6960ef619aad7b987353075b5fdd4ad00 for 10000ms
2019-11-19T12:23:56.910192: Hostname: Platform.localHostname
stdout: Parsing /Users/flutter/.cocoon/flutter/dev/benchmarks/macrobenchmarks/build/instrumentscli0.trace
2019-11-19T12:23:59.487925: Hostname: Platform.localHostname
stdout: 00:00.000.000  0 FPS 15.0% GPU
2019-11-19T12:23:59.490546: Hostname: Platform.localHostname
stderr: Unhandled exception:
stderr: Exception: No valid measurements found.
2019-11-19T12:23:59.490693: Hostname: Platform.localHostname
stderr: #0      IosTraceParser._average (package:gauge/parser.dart:112:7)
stderr: #1      IosTraceParser._computeCpuPercent (package:gauge/parser.dart:105:12)
stderr: #2      IosTraceParser.parseCpuGpu (package:gauge/parser.dart:62:47)
stderr: #3      IosCpuGpuNew.run (package:gauge/commands/ioscpugpu/new.dart:62:40)
stderr: 
stderr: #4      CommandRunner.runCommand (package:args/command_runner.dart:197:27)
stderr: 
stderr: #5      CommandRunner.run. (package:args/command_runner.dart:112:25)
stderr: #6      new Future.sync (dart:async/future.dart:224:31)
stderr: #7      CommandRunner.run (package:args/command_runner.dart:112:14)
stderr: #8      main (file:///Users/flutter/.pub-cache/hosted/pub.dartlang.org/gauge-0.1.4/bin/gauge.dart:15:10)
stderr: #9      _startIsolate. (dart:isolate-patch/isolate_patch.dart:303:32)
stderr: #10     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
2019-11-19T12:23:59.495504: Hostname: Platform.localHostname
"pub" exit code: 255

Activity

  1. added
    a: tests"flutter test", flutter_test, or one of our tests
    on Nov 20, 2019
  2. added a commit that references this issue on Nov 21, 2019
  3. zanderso commented on Feb 4, 2020

    @zanderso
    Member

    @liyuqian I've seen this come up again recently. Were you able to root-cause this?

  4. liyuqian commented on Feb 5, 2020

    @liyuqian
    ContributorAuthor

    @gaaclarke is working on #45435 which should fix this. @gaaclarke : can you please share some update on that issue? (Let's put the update in #45435 and CC Zach).

  5. gaaclarke commented on Feb 5, 2020

    @gaaclarke
    Member

    All my updates are in #45435 . I stopped looking into it when I realized that it will require a big investment to find a workaround (multiple weeks of work).

  6. zanderso commented on Feb 5, 2020

    @zanderso
    Member

    @gaaclarke Is there some subset of that work that would address the test flakes?

  7. gaaclarke commented on Feb 5, 2020

    @gaaclarke
    Member

    I never looked into the test flakes, i've only looked into the problems with the latest versions of XCode. Those problems are able to manifest 100% of the time.

  8. godofredoc commented on Feb 5, 2020

    @godofredoc
    Contributor

    This problem is affecting over 20% of the test runs even when they are running on the same machine and using Xcode 10.3 and iOS 12.3.

    @gaaclarke if the problem is difficult to fix is it possible to mitigate it with some retries?

  9. zanderso commented on Feb 5, 2020

    @zanderso
    Member

    Even if the underlying problem is difficult to fix, if it is affecting 20% of the test runs, we need to prioritize fixing it.

  10. gaaclarke commented on Feb 5, 2020

    @gaaclarke
    Member

    @godofredoc That sounds reasonable to me in the short term. I don't know if the flakey issue is hard to fix. I'm not sure if it's worth looking into, beyond retries, since we want to fix gauge for the new SDK.

    I'm not sure if it is clear from the other issue but gauge is built on top of a tool that uses undocumented Apple api's. Apple doesn't provide an api to programmatically process the results of Instruments probes. We should try to communicate that feature request to Apple.

  11. gaaclarke commented on Feb 5, 2020

    @gaaclarke
    Member

    I've sent out an email and CC'd @zanderso @liyuqian and @godofredoc so we can get the feature request process running in parallel.

  12. zanderso commented on Feb 5, 2020

    @zanderso
    Member

    /cc @jmagman who might also be interested in this area.

  13. jmagman commented on Feb 6, 2020

    @jmagman
    Member

    /cc @jmagman who might also be interested in this area.

    Commented in #45435 (comment)

    Can we flip this around and use e2e or some other runner to leverage XCTest? measureWithMetrics:options:block: is new in Xcode 11. Test results can be parsed with the xcresulttool shipped with Xcode.

    https://developer.apple.com/documentation/xctest/xctestcase/3194265-measurewithmetrics?language=objc

    I see
    XCTClockMetric
    XCTCPUMetric
    XCTMemoryMetric
    XCTOSSignpostMetric
    XCTStorageMetric

  14. goderbauer commented on Feb 27, 2020

    @goderbauer
    Member

    From #50367 it sounds like these tests have been disabled for the time being.

    It seems like we are tracking re-enabling in #45435. Should we close this bug then?

  15. liyuqian commented on Feb 27, 2020

    @liyuqian
    ContributorAuthor

    Sure, let's close it for now, and see how flaky our new tool would be once #45435 is fixed.

  16. github-actions commented on Aug 22, 2021

    @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.

  17. locked as resolved and limited conversation to collaborators on Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: tests"flutter test", flutter_test, or one of our testsc: flakeTests that sometimes, but not always, incorrectly passframeworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions