Repository: flutter
Issue: `flutter test` can't run multiple integration test files on desktop
Labels: a: tests,tool,platform-mac,platform-linux,a: desktop,P2,team-tool,triaged-tool

(This may well apply to the other desktop platform as well; I haven't tried them, but a lot of the `flutter` code to run desktop apps is similar across platforms.)

STR:
1. Check out flutter/packages and cd to `packages/video_player/video_player/example`
2. Run `flutter test -d macos integration_test/controller_swap_test.dart`
3. Run `flutter test -d macos integration_test/video_player_test.dart`
4. Run `flutter test -d macos integration_test/`

Steps 2 and 3 work fine. Step 4 however, which should have essentially the same effect as 2+3 (those are the two test files in that directory), runs one set of tests—the app visibly launches, then quits—then when it tries to run the second launches the app but doesn't run tests, and instead logs:

```
  TestDeviceException(Unable to start the app on the device.)
  package:flutter_tools/src/test/integration_test_device.dart 63:7  IntegrationTestTestDevice.start
  
  Bad state: Cannot add new events after calling close
  dart:async/broadcast_stream_controller.dart 243:24  _BroadcastStreamController.add
  dart:async/zone.dart 1407:47                        _rootRunUnary
  dart:async/zone.dart 1308:19                        _CustomZone.runUnary
  dart:async/zone.dart 1217:7                         _CustomZone.runUnaryGuarded
  dart:async/stream_impl.dart 339:11                  _BufferingStreamSubscription._sendData
  dart:async/stream_impl.dart 271:7                   _BufferingStreamSubscription._add
  dart:async/stream_controller.dart 784:19            _SyncStreamControllerDispatch._sendData
  dart:async/stream_controller.dart 658:7             _StreamController._add
  dart:async/stream_controller.dart 606:5             _StreamController.add
  dart:io-patch/socket_patch.dart 2447:41             _Socket._onData
  dart:async/zone.dart 1415:13                        _rootRunUnary
  dart:async/zone.dart 1308:19                        _CustomZone.runUnary
  dart:async/zone.dart 1217:7                         _CustomZone.runUnaryGuarded
  dart:async/stream_impl.dart 339:11                  _BufferingStreamSubscription._sendData
  dart:async/stream_impl.dart 271:7                   _BufferingStreamSubscription._add
  dart:async/stream_controller.dart 784:19            _SyncStreamControllerDispatch._sendData
  dart:async/stream_controller.dart 658:7             _StreamController._add
  dart:async/stream_controller.dart 606:5             _StreamController.add
  dart:io-patch/socket_patch.dart 1936:33             new _RawSocket.<fn>
  dart:io-patch/socket_patch.dart 1379:14             _NativeSocket.issueReadEvent.issue
  dart:async/schedule_microtask.dart 40:21            _microtaskLoop
  dart:async/schedule_microtask.dart 49:5             _startMicrotaskLoop
  dart:isolate-patch/isolate_patch.dart 118:13        _runPendingImmediateCallback
  dart:isolate-patch/isolate_patch.dart 185:5         _RawReceivePort._handleMessage
```

and then sits there doing nothing with the app still open.

It looks like something about the `flutter test` logic for desktop is trying to re-use a stream when it does subsequent launches.