Fixed leak and removed no-shuffle tag in scheduler_test.dart (#88423)
Co-authored-by: Alexander Dahlberg <alexander.dahlberg@sigma.se> This PR fixed the problem that has prevented scheduler_test.dart being shuffled. Part of #85160. One test schedules a task, but events are locked so the scheduled task does not execute and this messes up other tests. This PR adds a teardown that executes the scheduled task after the test, when events are unlocked.
This commit is contained in:
committed by
GitHub
parent
2ee0234471
commit
83b9e99cfb
@@ -2,12 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// TODO(gspencergoog): Remove this tag once this test's state leaks/test
|
||||
// dependencies have been fixed.
|
||||
// https://github.com/flutter/flutter/issues/85160
|
||||
// Fails with "flutter test --test-randomize-ordering-seed=123"
|
||||
@Tags(<String>['no-shuffle'])
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:ui' show window;
|
||||
|
||||
@@ -140,6 +134,10 @@ void main() {
|
||||
for (final VoidCallback timer in timerQueueTasks) {
|
||||
timer();
|
||||
}
|
||||
|
||||
// As events are locked, make scheduleTask execute after the test or it
|
||||
// will execute during following tests and risk failure.
|
||||
addTearDown(() => scheduler.handleEventLoopCallback());
|
||||
});
|
||||
|
||||
test('Flutter.Frame event fired', () async {
|
||||
|
||||
Reference in New Issue
Block a user