Unverified Commit f3ee3712 authored by Alexander Dahlberg's avatar Alexander Dahlberg Committed by GitHub

Fixed test in language_version_test.dart that failed when shuffling, … (#142904)

…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.
parent 809a27ea
...@@ -2,13 +2,6 @@ ...@@ -2,13 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // 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(<String>['no-shuffle'])
library;
import 'package:file/memory.dart'; import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/dart/language_version.dart'; import 'package:flutter_tools/src/dart/language_version.dart';
...@@ -282,6 +275,7 @@ library funstuff; ...@@ -282,6 +275,7 @@ library funstuff;
testWithoutContext('defaults to current version if package lookup returns null', () { testWithoutContext('defaults to current version if package lookup returns null', () {
final FileSystem fileSystem = MemoryFileSystem.test(); final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart') final File file = fileSystem.file('example.dart')
..writeAsStringSync(''' ..writeAsStringSync('''
// Some license // Some license
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment