Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web hot restart tests flaky timeout frequently causing web_tool_tests failure #85043

Closed
zanderso opened this issue Jun 22, 2021 · 30 comments · Fixed by #86832
Closed

Web hot restart tests flaky timeout frequently causing web_tool_tests failure #85043

zanderso opened this issue Jun 22, 2021 · 30 comments · Fixed by #86832
Assignees
Labels
a: tests "flutter test", flutter_test, or one of our tests c: disabled test Tracks the restoration of a disabled test c: flake Tests that sometimes, but not always, incorrectly pass P1 High-priority issues at the top of the work list platform-web Web applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@zanderso
Copy link
Member

zanderso commented Jun 22, 2021

See https://ci.chromium.org/p/flutter/builders/prod/Windows%20web_tool_tests

In particular:

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8843718898922094865/+/u/run_test.dart_for_web_tool_tests_shard_and_subshard_web/stdout?format=raw

It looks like this started happening with an Engine roll containing only a Fuchsia SDK roll, so it is probably unrelated.

/cc @yjbanov @shihaohong

@zanderso zanderso added a: tests "flutter test", flutter_test, or one of our tests team: flakes platform-web Web applications specifically c: disabled test Tracks the restoration of a disabled test labels Jun 22, 2021
zanderso added a commit that referenced this issue Jun 22, 2021
zanderso added a commit that referenced this issue Jun 22, 2021
@zanderso
Copy link
Member Author

@annagrin

@zanderso zanderso added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 22, 2021
zanderso added a commit that referenced this issue Jun 22, 2021
* Update hot_reload_web_test.dart

For #85043

* Add missing import
@keyonghan keyonghan changed the title We hot restart test flaky timeout frequently on Windows/canvaskit We hot restart test flaky timeout frequently on Windows/canvaskit, causing Windows web_tool_tests 2.74% flaky Jun 22, 2021
@keyonghan keyonghan added the c: flake Tests that sometimes, but not always, incorrectly pass label Jun 22, 2021
@alexmarkov
Copy link
Contributor

alexmarkov commented Jun 23, 2021

@jonahwilliams
Copy link
Member

looking in the logs I see some canvaskit errors. ill switch the apps to use html

@zanderso zanderso changed the title We hot restart test flaky timeout frequently on Windows/canvaskit, causing Windows web_tool_tests 2.74% flaky Web hot restart test flaky timeout frequently on Windows causing Windows web_tool_tests 2.74% flaky Jun 30, 2021
@zanderso zanderso added the P1 label Jun 30, 2021
@zanderso
Copy link
Member Author

@yjbanov ptal

@zanderso zanderso changed the title Web hot restart test flaky timeout frequently on Windows causing Windows web_tool_tests 2.74% flaky Web hot restart tests flaky timeout frequently causing web_tool_tests failure Jun 30, 2021
@alexmarkov
Copy link
Contributor

The test failed on the head-head-head bot today in the following way:

01:57 +1 ~15 -1: test/web.shard/hot_reload_web_test.dart: hot restart works without error [E]                                                                                                          
  Exception: Exception: Received app.stop event while waiting for app.started event
  
  [ +101 ms] FINE: Pub 2.14.0-edge.d5a97be46681feb703031587bfc35945d9d36744
  [  +44 ms] SLVR: fact: test is 0.0.0
  [  +13 ms] SLVR: derived: test
  [  +29 ms] SLVR: fact: test depends on flutter any from sdk
  [   +1 ms] SLVR:   selecting test
  [        ] SLVR:   derived: flutter any from sdk
  [  +19 ms] SLVR:   fact: flutter 0.0.0 from sdk depends on characters 1.1.0
  [        ] SLVR:   fact: flutter 0.0.0 from sdk depends on collection 1.15.0
  [        ] SLVR:   fact: flutter 0.0.0 from sdk depends on meta 1.7.0
  [        ] SLVR:   fact: flutter 0.0.0 from sdk depends on typed_data 1.3.0
  [        ] SLVR:   fact: flutter 0.0.0 from sdk depends on vector_math 2.1.0
  [        ] SLVR:   fact: flutter 0.0.0 from sdk depends on sky_engine any from sdk
  [   +1 ms] SLVR:     selecting flutter 0.0.0 from sdk
  [        ] SLVR:     derived: sky_engine any from sdk
  [        ] SLVR:     derived: vector_math 2.1.0
  [        ] SLVR:     derived: typed_data 1.3.0
  [        ] SLVR:     derived: meta 1.7.0
  [        ] SLVR:     derived: collection 1.15.0
  [        ] SLVR:     derived: characters 1.1.0
  [   +4 ms] SLVR:       selecting sky_engine 0.0.99 from sdk
  [   +8 ms] SLVR:         selecting vector_math 2.1.0
  [   +6 ms] SLVR:         fact: typed_data 1.3.0 depends on collection ^1.15.0
  [        ] SLVR:           selecting typed_data 1.3.0
  [   +3 ms] SLVR:             selecting meta 1.7.0
  [   +2 ms] SLVR:               selecting collection 1.15.0
  [   +2 ms] SLVR:                 selecting characters 1.1.0
  [  +87 ms] SLVR: Version solving took 0:00:00.192917 seconds.
  [        ]     | Tried 1 solutions.
  [        ] FINE: Resolving dependencies finished (0.236s).
  [  +68 ms] IO  : Writing 1105 characters to text file ./pubspec.lock.
  [        ] FINE: Contents:
  [        ]     | # Generated by pub
  [        ]     | # See https://dart.dev/tools/pub/glossary#lockfile
  [        ]     | packages:
  [        ]     |   characters:
  [        ]     |     dependency: transitive
  [        ]     |     description:
  [        ]     |       name: characters
  [        ]     |       url: "https://pub.dartlang.org"
  [        ]     |     source: hosted
  [        ]     |     version: "1.1.0"
  [        ]     |   collection:
  [        ]     |     dependency: transitive
  [        ]     |     description:
  [        ]     |       name: collection
  [        ]     |       url: "https://pub.dartlang.org"
  [        ]     |     source: hosted
  [        ]     |     version: "1.15.0"
  [        ]     |   flutter:
  [        ]     |     dependency: "direct main"
  [        ]     |     description: flutter
  [        ]     |     source: sdk
  [        ]     |     version: "0.0.0"
  [        ]     |   meta:
  [        ]     |     dependency: transitive
  [        ]     |     description:
  [        ]     |       name: meta
  [        ]     |       url: "https://pub.dartlang.org"
  [        ]     |     source: hosted
  [        ]     |     version: "1.7.0"
  [        ]     |   sky_engine:
  [        ]     |     dependency: transitive
  [        ]     |     description: flutter
  [        ]     |     source: sdk
  [        ]     |     version: "0.0.99"
  [        ]     |   typed_data:
  [        ]     |     dependency: transitive
  [        ]     |     description:
  [        ]     |       name: typed_data
  [        ]     |       url: "https://pub.dartlang.org"
  [        ]     |     source: hosted
  [        ]     |     version: "1.3.0"
  [        ]     |   vector_math:
  [        ]     |     dependency: transitive
  [        ]     |     description:
  [        ]     |       name: vector_math
  [        ]     |       url: "https://pub.dartlang.org"
  [        ]     |     source: hosted
  [        ]     |     version: "2.1.0"
  [        ]     | sdks:
  [        ]     |   dart: ">=2.12.0 <3.0.0"
  [   +3 ms] IO  : Writing 826 characters to text file ./.packages.
  [        ] FINE: Contents:
  [        ]     | # This file is deprecated. Tools should instead consume 
  [        ]     | # `.dart_tools/package_config.json`.
  [        ]     | # 
  [        ]     | # For more info see: https://dart.dev/go/dot-packages-deprecation
  [        ]     | # 
  [        ]     | # Generated by pub on 2021-07-12 12:52:47.642237.
  [        ]     | characters:file:///home/chrome-bot/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0/lib/
  [        ]     | collection:file:///home/chrome-bot/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/lib/
  [        ]     | flutter:file:///b/s/w/ir/cache/builder/flutter/packages/flutter/lib/
  [        ]     | meta:file:///home/chrome-bot/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/
  [        ]     | sky_engine:file:///b/s/w/ir/cache/builder/flutter/bin/cache/pkg/sky_engine/lib/
  [        ]     | typed_data:file:///home/chrome-bot/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/
  [        ]     | vector_math:file:///home/chrome-bot/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib/
  [        ]     | test:lib/
  [   +9 ms] IO  : Writing 1645 characters to text file ./.dart_tool/package_config.json.
  [        ] FINE: Contents:
  [        ]     | {
  [        ]     |   "configVersion": 2,
  [        ]     |   "packages": [
  [        ]     |     {
  [        ]     |       "name": "characters",
  [        ]     |       "rootUri": "file:///home/chrome-bot/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0",
  [        ]     |       "packageUri": "lib/",
  [        ]     |       "languageVersion": "2.12"
  [        ]     |     },
  [        ]     |     {
  [        ]     |       "name": "collection",
  [        ]     |       "rootUri": "file:///home/chrome-bot/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0",
  [        ]     |       "packageUri": "lib/",
  [        ]     |       "languageVersion": "2.12"
  [        ]     |     },
  [        ]     |     {
  [        ]     |       "name": "flutter",
  [        ]     |       "rootUri": "file:///b/s/w/ir/cache/builder/flutter/packages/flutter",
  [        ]     |       "packageUri": "lib/",
  [        ]     |       "languageVersion": "2.12"
  [        ]     |     },
  [        ]     |     {
  [        ]     |       "name": "meta",
  [        ]     |       "rootUri": "file:///home/chrome-bot/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0",
  [        ]     |       "packageUri": "lib/",
  [        ]     |       "languageVersion": "2.12"
  [        ]     |     },
  [        ]     |     {
  [        ]     |       "name": "sky_engine",
  [        ]     |       "rootUri": "file:///b/s/w/ir/cache/builder/flutter/bin/cache/pkg/sky_engine",
  [        ]     |       "packageUri": "lib/",
  [        ]     |       "languageVersion": "2.12"
  [        ]     |     },
  [        ]     |     {
  [        ]     |       "name": "typed_data",
  [        ]     |       "rootUri": "file:///home/chrome-bot/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0",
  [        ]     |       "packageUri": "lib/",
  [        ]     |       "languageVersion": "2.12"
  [        ]     |     },
  [        ]     |     {
  [        ]     |       "name": "vector_math",
  [        ]     |       "rootUri": "file:///home/chrome-bot/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0",
  [        ]     |       "packageUri": "lib/",
  [        ]     |       "languageVersion": "2.12"
  [        ]     |     },
  [        ]     |     {
  [        ]     |       "name": "test",
  [        ]     |       "rootUri": "../",
  [        ]     |       "packageUri": "lib/",
  [        ]     |       "languageVersion": "2.12"
  [        ]     |     }
  [        ]     |   ],
  [        ]     |   "generated": "2021-07-12T19:52:47.656560Z",
  [        ]     |   "generator": "pub",
  [        ]     |   "generatorVersion": "2.14.0-edge.d5a97be46681feb703031587bfc35945d9d36744"
  [        ]     | }
  Failed to establish connection with the application instance in Chrome.
  This can happen if the websocket connection used by the web tooling is unable to correctly establish a connection, for example due to a firewall.
  
  #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
  #1      ResidentWebRunner.run (package:flutter_tools/src/isolated/resident_web_runner.dart:328:7)
  <asynchronous suspension>
  #2      AppDomain.launch.<anonymous closure> (package:flutter_tools/src/commands/daemon.dart:595:9)
  <asynchronous suspension>
  #3      AppDomain.launch (package:flutter_tools/src/commands/daemon.dart:593:5)
  <asynchronous suspension>
  #4      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:552:15)
  <asynchronous suspension>
  #5      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1126:27)
  <asynchronous suspension>
  #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
  <asynchronous suspension>
  #7      CommandRunner.runCommand (package:args/command_runner.dart:196:13)
  <asynchronous suspension>
  #8      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
  <asynchronous suspension>
  #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
  <asynchronous suspension>
  #10     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
  <asynchronous suspension>
  #11     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
  <asynchronous suspension>
  #12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
  <asynchronous suspension>
  #13     main (package:flutter_tools/executable.dart:92:3)
  <asynchronous suspension>
  
  
  
  

01:57 +1 ~15 -1: loading test/web.shard/hot_reload_web_test.dart                                                                                                                                       
Consider enabling the flag chain-stack-traces to receive more detailed exceptions.
For example, 'pub run test --chain-stack-traces'.

@annagrin
Copy link
Contributor

@alexmarkov could you please share a link to the failure? I am only seeing engine tests failing currently...

@annagrin
Copy link
Contributor

Looks like the HHH bot is fine now, so the issue seems to be intermittent. Created a separate issue to investigate (above).

@yjbanov
Copy link
Contributor

yjbanov commented Jul 21, 2021

@annagrin Would you mind taking this issue? This is outside my domain expertise.

@jonahwilliams
Copy link
Member

The failing test is "hot_reload_web_test.dart: newly added code executes during hot restart - canvaskit"

This one should still be disabled since the flakiness is caused by downloading canvaskit over the network

@zanderso
Copy link
Member Author

#86885

@fluttergithubbot
Copy link
Contributor

Current flaky ratio for the past 15 days is 0.63%.
One recent flaky example for a same commit: https://ci.chromium.org/ui/p/flutter/builders/prod/Windows%20web_tool_tests/2876
Commit: c2f09e0
Flaky builds:
https://ci.chromium.org/ui/p/flutter/builders/prod/Windows%20web_tool_tests/2876

@fluttergithubbot fluttergithubbot added P2 and removed P1 labels Jul 26, 2021
@zanderso
Copy link
Member Author

My understanding is that the current status of this is that it is waiting for the canvaskit pin to re-enable the disabled test. Dropping priority based on that.

@zanderso zanderso added P1 High-priority issues at the top of the work list and removed P2 labels Jul 26, 2021
@annagrin
Copy link
Contributor

@annagrin This issue has a tag indicating that a test was disabled for it. Did you also re-enable the tests that were disabled?

@zanderso Looks like this issue bundles a few issues together - hot restart hangs, errors on connection to chrome, and canvaskit binding errors. I enabled two tests in packages/flutter_tools/test/web.shard/hot_reload_web_test.dart but it looks like one of them is still failing due to canvaskit issue. Thanks for disabling it!

I'll keep monitoring this issue to see if my fix stops flakiness due to hot restart hangs.

@fluttergithubbot
Copy link
Contributor

Current flaky ratio for the past 15 days is 0.56%.
One recent flaky example for a same commit: https://ci.chromium.org/ui/p/flutter/builders/prod/Windows%20web_tool_tests/2876
Commit: c2f09e0
Flaky builds:
https://ci.chromium.org/ui/p/flutter/builders/prod/Windows%20web_tool_tests/2876

@fluttergithubbot
Copy link
Contributor

Current flaky ratio for the past 15 days is 0.00%.

1 similar comment
@fluttergithubbot
Copy link
Contributor

Current flaky ratio for the past 15 days is 0.00%.

@fluttergithubbot
Copy link
Contributor

Current flaky ratio for the past 15 days is 0.76%.
One recent flaky example for a same commit: https://ci.chromium.org/ui/p/flutter/builders/prod/Windows%20web_tool_tests/3143
Commit: 3216e9f
Flaky builds:
https://ci.chromium.org/ui/p/flutter/builders/prod/Windows%20web_tool_tests/3143

@annagrin
Copy link
Contributor

A new flake - looks like we are not retrying when connecting to a chrome tab:

final ChromeTab chromeTab = await chrome.chromeConnection.getTab((ChromeTab chromeTab) {

/cc @jonahwilliams I think we could just pass a retry: 5 or some number there?

@fluttergithubbot
Copy link
Contributor

Current flaky ratio for the past 15 days is 0.57%.
One recent flaky example for a same commit: https://ci.chromium.org/ui/p/flutter/builders/prod/Windows%20web_tool_tests/3143
Commit: 3216e9f
Flaky builds:
https://ci.chromium.org/ui/p/flutter/builders/prod/Windows%20web_tool_tests/3143

@zanderso
Copy link
Member Author

@annagrin I'm not sure @jonahwilliams is reading here anymore if that question was directed at him. If a retry there could succeed after an initial failure, then that sounds like something that could deflake the test.

@fluttergithubbot
Copy link
Contributor

Current flaky ratio for the past 15 days is 0.00%.

@annagrin
Copy link
Contributor

annagrin commented Sep 7, 2021

@zanderso I will add the retries to see if it has any effect, but it looks like the occurrences are pretty rare at the moment.

@fluttergithubbot
Copy link
Contributor

Current flaky ratio for the past 15 days is 0.00%.

1 similar comment
@fluttergithubbot
Copy link
Contributor

Current flaky ratio for the past 15 days is 0.00%.

@annagrin
Copy link
Contributor

Closing this as there have been no flakiness for a month, please feel free to reopen if needed!

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: tests "flutter test", flutter_test, or one of our tests c: disabled test Tracks the restoration of a disabled test c: flake Tests that sometimes, but not always, incorrectly pass P1 High-priority issues at the top of the work list platform-web Web applications specifically tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants