Unverified Commit 47b5ed39 authored by Alexander Dahlberg's avatar Alexander Dahlberg Committed by GitHub

Removed no-shuffle tag and fixed order dependency in daemon_test.dart (#98970)

parent 6a9ac450
...@@ -4,12 +4,6 @@ ...@@ -4,12 +4,6 @@
// @dart = 2.8 // @dart = 2.8
// 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=1000"
@Tags(<String>['no-shuffle'])
import 'dart:async'; import 'dart:async';
import 'dart:io' as io; import 'dart:io' as io;
import 'dart:typed_data'; import 'dart:typed_data';
...@@ -79,12 +73,12 @@ class FakeDaemonStreams implements DaemonStreams { ...@@ -79,12 +73,12 @@ class FakeDaemonStreams implements DaemonStreams {
void main() { void main() {
Daemon daemon; Daemon daemon;
NotifyingLogger notifyingLogger; NotifyingLogger notifyingLogger;
BufferLogger bufferLogger;
group('daemon', () { group('daemon', () {
FakeDaemonStreams daemonStreams; FakeDaemonStreams daemonStreams;
DaemonConnection daemonConnection; DaemonConnection daemonConnection;
setUp(() { setUp(() {
BufferLogger bufferLogger;
bufferLogger = BufferLogger.test(); bufferLogger = BufferLogger.test();
notifyingLogger = NotifyingLogger(verbose: false, parent: bufferLogger); notifyingLogger = NotifyingLogger(verbose: false, parent: bufferLogger);
daemonStreams = FakeDaemonStreams(); daemonStreams = FakeDaemonStreams();
...@@ -677,15 +671,23 @@ void main() { ...@@ -677,15 +671,23 @@ void main() {
}); });
}); });
testUsingContext('notifyingLogger outputs trace messages in verbose mode', () async { group('notifyingLogger', () {
final NotifyingLogger logger = NotifyingLogger(verbose: true, parent: bufferLogger); BufferLogger bufferLogger;
setUp(() {
bufferLogger = BufferLogger.test();
});
logger.printTrace('test'); tearDown(() {
bufferLogger.clear();
});
testUsingContext('outputs trace messages in verbose mode', () async {
final NotifyingLogger logger = NotifyingLogger(verbose: true, parent: bufferLogger);
logger.printTrace('test');
expect(bufferLogger.errorText, contains('test')); expect(bufferLogger.errorText, contains('test'));
}); });
testUsingContext('notifyingLogger ignores trace messages in non-verbose mode', () async { testUsingContext('ignores trace messages in non-verbose mode', () async {
final NotifyingLogger logger = NotifyingLogger(verbose: false, parent: bufferLogger); final NotifyingLogger logger = NotifyingLogger(verbose: false, parent: bufferLogger);
final Future<LogMessage> messageResult = logger.onMessage.first; final Future<LogMessage> messageResult = logger.onMessage.first;
...@@ -696,10 +698,10 @@ void main() { ...@@ -696,10 +698,10 @@ void main() {
expect(message.level, 'status'); expect(message.level, 'status');
expect(message.message, 'hello'); expect(message.message, 'hello');
expect(bufferLogger.errorText, contains('test')); expect(bufferLogger.errorText, isEmpty);
}); });
testUsingContext('notifyingLogger buffers messages sent before a subscription', () async { testUsingContext('buffers messages sent before a subscription', () async {
final NotifyingLogger logger = NotifyingLogger(verbose: false, parent: bufferLogger); final NotifyingLogger logger = NotifyingLogger(verbose: false, parent: bufferLogger);
logger.printStatus('hello'); logger.printStatus('hello');
...@@ -709,6 +711,7 @@ void main() { ...@@ -709,6 +711,7 @@ void main() {
expect(message.level, 'status'); expect(message.level, 'status');
expect(message.message, 'hello'); expect(message.message, 'hello');
}); });
});
group('daemon queue', () { group('daemon queue', () {
DebounceOperationQueue<int, String> queue; DebounceOperationQueue<int, String> queue;
......
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