Skip to content

Commit

Permalink
Fix flaky tests and unskip (#932)
Browse files Browse the repository at this point in the history
Closes #924

Related: dart-lang/test#1203
  • Loading branch information
grouma authored Mar 20, 2020
1 parent 6dec373 commit 8cdb0e8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
5 changes: 3 additions & 2 deletions dwds/lib/src/dwds_vm_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ class DwdsVmClient {
client.registerServiceCallback('hotRestart', (request) async {
await _disableBreakpointsAndResume(client, chromeProxyService);
var context = await chromeProxyService.executionContext.id;
// Start listening for isolate create events before issuing a hot
// restart. Only return success after the isolate has fully started.
var stream = chromeProxyService.onEvent('Isolate');
try {
await chromeProxyService.remoteDebugger
.sendCommand('Runtime.evaluate', params: {
Expand All @@ -77,8 +80,6 @@ class DwdsVmClient {
};
}
}
// Only return success after the isolate has fully started.
var stream = chromeProxyService.onEvent('Isolate');
await stream.firstWhere((event) => event.kind == EventKind.kIsolateStart);
return {'result': Success().toJson()};
});
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/inspector_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void main() {
var classRef = instance.classRef;
var clazz = await inspector.getObject(isolateId, classRef.id) as Class;
expect(clazz.name, 'MyTestClass<dynamic>');
}, skip: 'sdk/issues/40883');
});
});

group('loadField', () {
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/instance_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void main() {
classRef.id,
'classes|org-dartlang-app:///web/scopes_main.dart'
'|MyTestClass<dynamic>');
}, skip: 'sdk/issues/40883');
});

test('for closure', () async {
var remoteObject = await libraryPublicFinal();
Expand Down
2 changes: 2 additions & 0 deletions dwds/test/run_request_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@Timeout(Duration(minutes: 2))

import 'dart:async';

import 'package:dwds/src/connections/debug_connection.dart';
Expand Down
2 changes: 1 addition & 1 deletion webdev/lib/src/version.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions webdev/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: webdev
# Every time this changes you need to run `pub run build_runner build`.
version: 2.5.6
version: 2.5.7-dev
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/webdev
description: >-
Expand Down Expand Up @@ -45,4 +45,8 @@ dev_dependencies:
webdriver: ^2.0.0

executables:
webdev:
webdev:

dependency_overrides:
dwds:
path: ../dwds
10 changes: 8 additions & 2 deletions webdev/test/daemon/app_domain_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@Timeout(Duration(minutes: 2))
import 'dart:convert';
import 'dart:io';

import 'package:test/test.dart';

Expand Down Expand Up @@ -62,6 +63,11 @@ void main() {
var webdev =
await runWebDev(['daemon'], workingDirectory: exampleDirectory);
var appId = await waitForAppId(webdev);
if (Platform.isWindows) {
// Windows takes a bit longer to run the application and register
// the service extension.
await Future.delayed(const Duration(seconds: 5));
}
var extensionCall = '[{"method":"app.callServiceExtension","id":0,'
'"params" : { "appId" : "$appId", "methodName" : "ext.print"}}]';
webdev.stdin.add(utf8.encode('$extensionCall\n'));
Expand All @@ -72,7 +78,7 @@ void main() {
startsWith('[{"event":"app.log","params":{"appId":"$appId",'
'"log":"Hello World\\n"}}')));
await exitWebdev(webdev);
}, skip: 'webdev/issues/924');
});

test('.reload', () async {
var webdev =
Expand Down Expand Up @@ -108,7 +114,7 @@ void main() {
'[{"event":"app.progress","params":{"appId":"$appId","id":"1",'
'"finished":true')));
await exitWebdev(webdev);
}, skip: 'webdev/issues/924');
});

test('.stop', () async {
var webdev =
Expand Down

0 comments on commit 8cdb0e8

Please sign in to comment.