title: Flutter integration test running twice on web
body: <p><a href="https://github.com/flutter/flutter/issues/102250" rel="nofollow noreferrer">GitHub issue</a></p>
  <p>Setup:</p>
  <ol>
  <li>Clone <a href="https://github.com/garrettApproachableGeek/integration_tests_duplicated" rel="nofollow noreferrer">repository</a></li>
  <li>Run <code>chromedriver --port=4444</code> in another terminal</li>
  <li>Run <code>flutter drive --driver=test_driver/integration_test.dart --target=integration_test/example_test.dart -d chrome</code></li>
  </ol>
  <p>It seems like the test is running twice as there are two documents inserted into Firestore where there should only be one document inserted.</p>
  <p>This behavior is only happening on web, it doesn't produce the same behavior on iOS</p>
  <p>If you clone the repo and test it for yourself please change the collection name of <code>examples</code> to something else to not clash with other testers</p>
  <p>Code for when the repository is removed</p>
  <pre><code>void main() {
    IntegrationTestWidgetsFlutterBinding.ensureInitialized();
    final now = DateTime.now();
    const String collectionName = 'examples';
    String currentMinute = DateFormat.yMd().add_jm().format(now);
  
    documentsInsertedThisMinute() async {
      var collection = FirebaseFirestore.instance.collection(collectionName);
      var snapshots =
          await collection.where('foobar', isEqualTo: currentMinute).get();
      return snapshots.size;
    }
  
    setUpAll(() async {
      await Firebase.initializeApp(
        options: DefaultFirebaseOptions.currentPlatform,
      );
    });
  
    testWidgets(
      'Single document created',
      (WidgetTester tester) async {
        int preExistingDocuments = await documentsInsertedThisMinute();
        print('Pre-existing documents: $preExistingDocuments');
  
        await tester.pumpWidget(const MyApp());
  
        await FirebaseFirestore.instance
            .collection(collectionName)
            .doc()
            .set({'foobar': currentMinute});
  
        int documentsAfterSingleInsert = await documentsInsertedThisMinute();
        expect(documentsAfterSingleInsert, 1);
      },
    );
  }
  </code></pre>