From f3ee3712858c572cad8c973ebac847d11f84a278 Mon Sep 17 00:00:00 2001 From: Alexander Dahlberg Date: Mon, 5 Feb 2024 21:25:39 +0100 Subject: [PATCH] =?UTF-8?q?Fixed=20test=20in=20language=5Fversion=5Ftest.d?= =?UTF-8?q?art=20that=20failed=20when=20shuffling,=20=E2=80=A6=20(#142904)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …and removed the no-shuffle tag. This PR fixes #142376 by fixing the flaky test in language_version_test.dart and removes the no-shuffle tag.   ## The Problem The test expected the language version that is set at the top of the test file ('2.13' set in language_version_test.dart – line 14) but defaulted to the language version set in the file it is testing ('2.12' is set in language_version.dart). This problem was hidden when some other test ran before this test and set up the language version correctly.   ## The Fix Make the test itself load the default language version we are testing against. --- .../test/general.shard/dart/language_version_test.dart | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/flutter_tools/test/general.shard/dart/language_version_test.dart b/packages/flutter_tools/test/general.shard/dart/language_version_test.dart index 3e92a368f0..b36a9124c2 100644 --- a/packages/flutter_tools/test/general.shard/dart/language_version_test.dart +++ b/packages/flutter_tools/test/general.shard/dart/language_version_test.dart @@ -2,13 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TODO(team-tool): Remove this tag once this test's state leaks/test -// dependencies have been fixed. -// https://github.com/flutter/flutter/issues/142376 -// Fails with "flutter test --test-randomize-ordering-seed=20240127" -@Tags(['no-shuffle']) -library; - import 'package:file/memory.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/dart/language_version.dart'; @@ -282,6 +275,7 @@ library funstuff; testWithoutContext('defaults to current version if package lookup returns null', () { final FileSystem fileSystem = MemoryFileSystem.test(); + setUpLanguageVersion(fileSystem); final File file = fileSystem.file('example.dart') ..writeAsStringSync(''' // Some license