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.
This commit is contained in:
Alexander Dahlberg 2024-02-05 21:25:39 +01:00 committed by GitHub
parent 809a27ea67
commit f3ee371285
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(<String>['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