Repository: flutter
Issue: Flutter engine dart unit test failing on test Can fix C++ formatting errors
Labels: engine,P2,team-engine,triaged-engine,from: manual-qa

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

Install XCode 15.0 RC1 and iOS Simulator 17.0
[Compile the engine for testing](https://github.com/flutter/flutter/wiki/Compiling-the-engine#compiling-for-testing)
Run dart tests python3 flutter/testing/run_tests.py --type dart

### Expected results

All tests passed

### Actual results

The following test case fails

```console
Running command "/Volumes/ssd/engine/src/out/host_debug_unopt/dart-sdk/bin/dart --disable-dart-dev /Volumes/ssd/engine/src/flutter/ci/test/format_test.dart /Volumes/ssd/engine/src/flutter"
Test Can fix Java formatting errors: Skipped
unittest-suite-wait-for-done
Test "Can fix C++ formatting errors": Started
Test "Can fix C++ formatting errors": Failed
In test "Can fix C++ formatting errors" Expect.stringEquals(expected: <int main() {
  return 0;
}
>", <int main(){return 0;}
>) fails
Diff (10..25/20):
int main()[  {
  return 0;
 ]}

int main()[ {return 0; ]}

#0      Expect._fail (package:expect/expect.dart:721:5)
#1      Expect.stringEquals (package:expect/expect.dart:453:5)
#2      Expect.deepEquals (package:expect/expect.dart:535:7)
#3      equals.<anonymous closure> (package:async_helper/async_minitest.dart:162:14)
#4      expect (package:async_helper/async_minitest.dart:70:4)
#5      main.<anonymous closure> (file:///Volumes/ssd/engine/src/flutter/ci/test/format_test.dart:153:9)
#6      Test.run.<anonymous closure>.<anonymous closure> (package:litetest/src/test.dart:69:21)
#7      new Future.<anonymous closure> (dart:async/future.dart:256:37)
#8      _rootRun (dart:async/zone.dart:1391:47)
#9      _CustomZone.run (dart:async/zone.dart:1301:19)
#10     _CustomZone.runGuarded (dart:async/zone.dart:1209:7)
#11     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1249:23)
#12     _rootRun (dart:async/zone.dart:1399:13)
#13     _CustomZone.run (dart:async/zone.dart:1301:19)
#14     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1233:23)
#15     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#16     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#17     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#18     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

Test "Can fix GN formatting errors": Started
Test "Can fix GN formatting errors": Passed
Test "Can fix Python formatting errors": Started
Test "Can fix Python formatting errors": Passed
Test "Can fix whitespace formatting errors": Started
Test "Can fix whitespace formatting errors": Passed
unittest-suite-success
Unhandled exception:
A test failed
#0      _DefaultLifecycle._processResults (package:litetest/src/test_suite.dart:111:7)
#1      _DefaultLifecycle.onStart.<anonymous closure> (package:litetest/src/test_suite.dart:95:7)
#2      _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#3      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#4      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#5      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#6      _StreamController._add (dart:async/stream_controller.dart:658:7)
#7      _StreamController.add (dart:async/stream_controller.dart:606:5)
#8      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
The following commands failed:
/Volumes/ssd/engine/src/out/host_debug_unopt/dart-sdk/bin/dart --disable-dart-dev /Volumes/ssd/engine/src/flutter/ci/test/format_test.dart /Volumes/ssd/engine/src/flutter
Command "/Volumes/ssd/engine/src/out/host_debug_unopt/dart-sdk/bin/dart --disable-dart-dev /Volumes/ssd/engine/src/flutter/ci/test/format_test.dart /Volumes/ssd/engine/src/flutter" exited with code 255.

Traceback (most recent call last):
  File "/Volumes/ssd/engine/src/flutter/testing/run_tests.py", line 1277, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Volumes/ssd/engine/src/flutter/testing/run_tests.py", line 1239, in main
    run_engine_tasks_in_parallel(tasks)
  File "/Volumes/ssd/engine/src/flutter/testing/run_tests.py", line 1026, in run_engine_tasks_in_parallel
    raise Exception()
Exception
```



### Code sample

<details><summary>Code sample</summary>

```dart
[Paste your code here]
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[!] Flutter (Channel [user-branch], 3.13.2, on macOS 13.5 22G74 darwin-arm64,
  locale en-UY)
  ! Flutter version 3.13.2 on channel [user-branch] at /Volumes/ssd/flutter
   Currently on an unknown channel. Run `flutter channel` to switch to an
   official channel.
   If that doesn't fix the issue, reinstall Flutter by following instructions
   at https://flutter.dev/docs/get-started/install.
  ! Upstream repository unknown source is not a standard remote.
   Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss
   this error.
  • Framework revision ff5b5b5fa6 (4 weeks ago), 2023-08-24 08:12:28 -0500
  • Engine revision b20183e040
  • Dart version 3.1.0
  • DevTools version 2.25.0
  • If those were intentional, you can disregard the above warnings; however
   it is recommended to use "git" directly to perform update checks and
   upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
  • Android SDK at /Users/gonzalososalago/Library/Android/sdk
  • Platform android-33, build-tools 33.0.1
  • Java binary at: /Applications/Android
   Studio.app/Contents/jbr/Contents/Home/bin/java
  • Java version OpenJDK Runtime Environment (build
   17.0.6+0-17.0.6b829.9-10027231)
  • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
  • Xcode at /Applications/Xcode.app/Contents/Developer
  • Build 15A240d
  • CocoaPods version 1.11.3
[✓] Chrome - develop for the web
  • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
  • Android Studio at /Applications/Android Studio.app/Contents
  • Flutter plugin can be installed from:
   :hammer: https://plugins.jetbrains.com/plugin/9212-flutter
  • Dart plugin can be installed from:
   :hammer: https://plugins.jetbrains.com/plugin/6351-dart
  • Java version OpenJDK Runtime Environment (build
   17.0.6+0-17.0.6b829.9-10027231)
[✓] VS Code (version 1.82.1)
  • VS Code at /Applications/Visual Studio Code.app/Contents
  • Flutter extension version 3.72.0
[✓] Connected device (2 available)
  • macOS (desktop) • macos • darwin-arm64  • macOS 13.5 22G74 darwin-arm64
  • Chrome (web)  • chrome • web-javascript • Google Chrome 116.0.5845.187
[✓] Network resources
  • All expected network resources are available.
```

</details>