Skip to content

Commit f565d7f

Browse files
author
Anna Gringauze
authored
Disable flaky test on windows (#2127)
1 parent 6eed300 commit f565d7f

File tree

1 file changed

+37
-31
lines changed

1 file changed

+37
-31
lines changed

dwds/test/web/batched_stream_test.dart

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,50 @@
66
@Timeout(Duration(minutes: 2))
77

88
import 'dart:async';
9+
import 'dart:io';
910

1011
import 'package:dwds/shared/batched_stream.dart';
1112
import 'package:test/expect.dart';
1213
import 'package:test/scaffolding.dart';
1314

1415
void main() {
1516
group('Batched stream controller', () {
16-
test('emits batches', () async {
17-
const size = 100;
18-
const delay = Duration(milliseconds: 1000);
19-
20-
final batchOne = List<int>.generate(size, (index) => index);
21-
final batchTwo = List<int>.generate(size, (index) => size + index);
22-
23-
// Setup controller.
24-
final controller = BatchedStreamController<int>(delay: 500);
25-
26-
// Verify the output.
27-
expect(
28-
controller.stream,
29-
emitsInOrder([
30-
batchOne,
31-
batchTwo,
32-
]),
33-
);
34-
35-
// Add input.
36-
final inputController = StreamController<int>();
37-
final inputAdded = controller.sink.addStream(inputController.stream);
38-
39-
batchOne.forEach(inputController.sink.add);
40-
await Future.delayed(delay);
41-
batchTwo.forEach(inputController.sink.add);
42-
43-
await inputController.close();
44-
await inputAdded;
45-
await controller.close();
46-
});
17+
test(
18+
'emits batches',
19+
() async {
20+
const size = 100;
21+
const delay = Duration(milliseconds: 1000);
22+
23+
final batchOne = List<int>.generate(size, (index) => index);
24+
final batchTwo = List<int>.generate(size, (index) => size + index);
25+
26+
// Setup controller.
27+
final controller = BatchedStreamController<int>(delay: 500);
28+
29+
// Verify the output.
30+
expect(
31+
controller.stream,
32+
emitsInOrder([
33+
batchOne,
34+
batchTwo,
35+
]),
36+
);
37+
38+
// Add input.
39+
final inputController = StreamController<int>();
40+
final inputAdded = controller.sink.addStream(inputController.stream);
41+
42+
batchOne.forEach(inputController.sink.add);
43+
await Future.delayed(delay);
44+
batchTwo.forEach(inputController.sink.add);
45+
46+
await inputController.close();
47+
await inputAdded;
48+
await controller.close();
49+
},
50+
// https://github.com/dart-lang/webdev/issues/2126
51+
skip: Platform.isWindows,
52+
);
4753

4854
test('emits all inputs in order', () async {
4955
const size = 10;

0 commit comments

Comments
 (0)