flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
161.86k stars 26.57k forks source link

src/test/flutter_tester_device.dart `!_gotProcessVmServiceUri.isCompleted` asserts when running /dev/devicelab tests #145964

Open Hixie opened 1 month ago

Hixie commented 1 month ago

STEPS TO REPRODUCE

  1. Add export FLUTTER_TOOL_ARGS=--enable-asserts to your .bashrc, or at least export it in your current shell.
  2. cd dev/devicelab from your flutter/flutter checkout.
  3. run flutter test.

EXPECTED RESULTS Tests pass.

ACTUAL RESULTS Many tests hit:

  'package:': Failed assertion: line 168 pos 16: '<optimized out>': is not true.
  [...]
  package:flutter_tools/src/test/flutter_tester_device.dart 168:16  FlutterTesterTestDevice.start.<fn>
  package:flutter_tools/src/test/flutter_tester_device.dart 359:39  FlutterTesterTestDevice._pipeStandardStreamsToConsole.<fn>
  [...]

The given line is in FlutterTesterTestDevice.start:

    _pipeStandardStreamsToConsole(
      process: _process!,
      reportVmServiceUri: (Uri detectedUri) async {
        assert(!_gotProcessVmServiceUri.isCompleted); // <-- THIS ASSERTS
        assert(debuggingOptions.hostVmServicePort == null ||
            debuggingOptions.hostVmServicePort == detectedUri.port);

I bisected this regression to https://github.com/flutter/flutter/pull/97683. cc @bkonyi