{"action":"created","issue":{"url":"https://api.github.com/repos/flutter/flutter/issues/22403","repository_url":"https://api.github.com/repos/flutter/flutter","labels_url":"https://api.github.com/repos/flutter/flutter/issues/22403/labels{/name}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/22403/comments","events_url":"https://api.github.com/repos/flutter/flutter/issues/22403/events","html_url":"https://github.com/flutter/flutter/pull/22403","id":364753346,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4ODYyODE2","number":22403,"title":"fix race in devicelab concurrent hot reload","user":{"login":"dnfield","id":8620741,"node_id":"MDQ6VXNlcjg2MjA3NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/8620741?v=4","gravatar_id":"","url":"https://api.github.com/users/dnfield","html_url":"https://github.com/dnfield","followers_url":"https://api.github.com/users/dnfield/followers","following_url":"https://api.github.com/users/dnfield/following{/other_user}","gists_url":"https://api.github.com/users/dnfield/gists{/gist_id}","starred_url":"https://api.github.com/users/dnfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnfield/subscriptions","organizations_url":"https://api.github.com/users/dnfield/orgs","repos_url":"https://api.github.com/users/dnfield/repos","events_url":"https://api.github.com/users/dnfield/events{/privacy}","received_events_url":"https://api.github.com/users/dnfield/received_events","type":"User","site_admin":false},"labels":[{"id":487496476,"node_id":"MDU6TGFiZWw0ODc0OTY0NzY=","url":"https://api.github.com/repos/flutter/flutter/labels/cla:%20yes","name":"cla: yes","color":"ffffff","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-28T06:08:32Z","updated_at":"2018-09-28T19:36:47Z","closed_at":"2018-09-28T16:01:40Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/flutter/flutter/pulls/22403","html_url":"https://github.com/flutter/flutter/pull/22403","diff_url":"https://github.com/flutter/flutter/pull/22403.diff","patch_url":"https://github.com/flutter/flutter/pull/22403.patch"},"body":"The concurrent hot reload test flakes out every so often when the 'appId' is processed before the 'vmServicePort', and the completer is marked as ready before the port is available.  This can be seen in the logs with things like:\r\n\r\n```\r\n2018-09-27T22:12:16.803141: run: ready!\r\n2018-09-27T22:12:16.823703: Task failed: FormatException: Invalid port (at character 16)\r\nws://localhost:null/ws\r\n               ^\r\n2018-09-27T22:12:16.823995: \r\n\r\nStack trace:2018-09-27T22:12:16.824087: \r\n2018-09-27T22:12:16.866707: dart:core                                                  Uri.parse\r\npackage:vm_service_client/vm_service_client.dart 111:35    new VMServiceClient.connect\r\nbin/tasks/run_machine_concurrent_hot_reload.dart 83:27     main..\r\n===== asynchronous gap ===========================\r\ndart:async                                                 _AsyncAwaitCompleter.completeError\r\nbin/tasks/run_machine_concurrent_hot_reload.dart           main..\r\n===== asynchronous gap ===========================\r\ndart:async                                                 _asyncThenWrapperHelper\r\nbin/tasks/run_machine_concurrent_hot_reload.dart           main..\r\npackage:flutter_devicelab/framework/utils.dart 379:24      inDirectory\r\n===== asynchronous gap ===========================\r\ndart:async                                                 _asyncThenWrapperHelper\r\nbin/tasks/run_machine_concurrent_hot_reload.dart           main.\r\npackage:flutter_devicelab/framework/framework.dart 128:32  _TaskRunner._performTask.\r\n\r\n2018-09-27T22:12:16.867792: Cleaning up after task...\r\n2018-09-27T22:12:16.868938: run:stdout: [  +72 ms] DevFS: Created new filesystem on the device (file:///data/user/0/com.yourcompany.integration_ui/cache/uiHBBIIT/ui/)\r\nrun:stdout: [{\"event\":\"app.debugPort\",\"params\":{\"appId\":\"faf415cb-0a0c-4f7e-a653-1da6a3491022\",\"port\":59238,\"wsUri\":\"ws://127.0.0.1:59238/ws\",\"baseUri\":\"file:///data/user/0/com.yourcompany.integration_ui/cache/uiHBBIIT/ui/\"}}]\r\n2018-09-27T22:12:16.869612: service protocol connection available at port 59238\r\n```\r\n\r\nThis should make the task less flaky."},"comment":{"url":"https://api.github.com/repos/flutter/flutter/issues/comments/425543745","html_url":"https://github.com/flutter/flutter/pull/22403#issuecomment-425543745","issue_url":"https://api.github.com/repos/flutter/flutter/issues/22403","id":425543745,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTU0Mzc0NQ==","user":{"login":"DanTup","id":1078012,"node_id":"MDQ6VXNlcjEwNzgwMTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1078012?v=4","gravatar_id":"","url":"https://api.github.com/users/DanTup","html_url":"https://github.com/DanTup","followers_url":"https://api.github.com/users/DanTup/followers","following_url":"https://api.github.com/users/DanTup/following{/other_user}","gists_url":"https://api.github.com/users/DanTup/gists{/gist_id}","starred_url":"https://api.github.com/users/DanTup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanTup/subscriptions","organizations_url":"https://api.github.com/users/DanTup/orgs","repos_url":"https://api.github.com/users/DanTup/repos","events_url":"https://api.github.com/users/DanTup/events{/privacy}","received_events_url":"https://api.github.com/users/DanTup/received_events","type":"User","site_admin":false},"created_at":"2018-09-28T19:36:47Z","updated_at":"2018-09-28T19:36:47Z","author_association":"MEMBER","body":">  the 'appId' is processed before the 'vmServicePort'\r\n\r\nDo we know if something changed recently to cause this?\r\n\r\nI've opened https://github.com/Dart-Code/Dart-Code/issues/1225 to make Dart Code not assume these come in a specific order too. I had a quick look at the IntelliJ code and I *think* it handles this [here](https://github.com/flutter/flutter-intellij/blob/4827875deb2555121d32327383cf0b81444c9342/src/io/flutter/server/vmService/DartVmServiceDebugProcess.java#L265) by checking every 100ms until it gets the port."}}
{"actor":{"display_login":"DanTup"}}