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

[url_launcher] link_widget_test.dart test failing on stable #121161

Closed
stuartmorgan opened this issue Feb 21, 2023 · 9 comments · Fixed by flutter/packages#3285
Closed

[url_launcher] link_widget_test.dart test failing on stable #121161

stuartmorgan opened this issue Feb 21, 2023 · 9 comments · Fixed by flutter/packages#3285
Assignees
Labels
a: tests "flutter test", flutter_test, or one of our tests p: url_launcher Plugin to launch external applications P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels. team Infra upgrades, team productivity, code health, technical debt. See also team: labels.

Comments

@stuartmorgan
Copy link
Contributor

In merging flutter/plugins into flutter/packages, I'm seeing persistent failures in the Link widget integration tests on web, but only on stable. I don't see any differences in the test config relative to flutter/plugins, where it's passing, so to avoid blocking the merge I'm going to turn it off for stable for now and we can investigate further after the merge.

/cc @ditman

@stuartmorgan stuartmorgan added a: tests "flutter test", flutter_test, or one of our tests team Infra upgrades, team productivity, code health, technical debt. See also team: labels. p: url_launcher Plugin to launch external applications package flutter/packages repository. See also p: labels. P1 High-priority issues at the top of the work list labels Feb 21, 2023
@ditman
Copy link
Member

ditman commented Feb 22, 2023

Looking at this.

@ditman ditman self-assigned this Feb 22, 2023
@ditman
Copy link
Member

ditman commented Feb 23, 2023

I cannot reproduce locally, I'm going to reenable the test in a branch, and see if I get more information about the failure there.

@ditman
Copy link
Member

ditman commented Feb 24, 2023

This seems to be the failure:

Failure in method: uri can be null
══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞══════════════════════
The following assertion was thrown during a scheduler callback:
Assertion failed:
org-dartlang-sdk:///lib/_engine/engine/canvaskit/surface.dart:401:12
!_isDisposed
"Attempting to use the canvas of a disposed surface"
When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49      throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3        assertFailed
lib/_engine/engine/canvaskit/surface.dart 401:13                                  getCanvas
lib/_engine/engine/canvaskit/surface.dart 34:42                                   get skiaCanvas
lib/_engine/engine/canvaskit/embedded_views.dart 418:38                           submitFrame
lib/_engine/engine/canvaskit/rasterizer.dart 36:33                                draw
lib/_engine/engine/canvaskit/renderer.dart 349:16                                 renderScene
lib/_engine/engine/platform_dispatcher.dart 645:14                                render
lib/ui/window.dart 107:50                                                         render
packages/flutter_test/src/window.dart.js 363:21                                   render
packages/flutter/src/rendering/view.dart.js 325:23                                compositeFrame
packages/flutter/src/rendering/view.dart.js 775:25                                drawFrame
packages/flutter/src/widgets/title.dart.js 69849:15                               drawFrame
packages/flutter/src/rendering/view.dart.js 734:12                                [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart.js 866:9                              [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart.js 833:37                             handleDrawFrame
packages/flutter_test/src/test_text_input_key_handler.dart.js 3034:15             handleDrawFrame
packages/flutter/src/scheduler/binding.dart.js 752:12                             [_handleDrawFrame]
dart-sdk/lib/async/zone.dart 1398:13                                              _rootRun
dart-sdk/lib/async/zone.dart 1300:19                                              run
dart-sdk/lib/async/zone.dart 1208:7                                               runGuarded
lib/_engine/engine/platform_dispatcher.dart 1170:9                                invoke
lib/_engine/engine/platform_dispatcher.dart 218:5                                 invokeOnDrawFrame
lib/_engine/engine/initialization.dart 190:45                                     <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 367:37  _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 372:39  dcall
═════════════════════════════════════════════════════════════════
end of failure 1
Failure in method: can be created and disposed
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
The following message was thrown:
Multiple exceptions (22) were detected during the running of the
current test, and at least one was unexpected.
═════════════════════════════════════════════════════════════════
end of failure 2

https://cirrus-ci.com/task/6243034824704000?logs=drive#L423

(There's also a failures in google_maps_flutter_web: example/integration_test/google_maps_controller_test.dart, in both channels??)

integration_test/google_maps_controller_test.dart is being served at http://localhost:7357
The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome or Edge devices for an improved development workflow.
Failure Details:
Failure in method: newLatLngZoom
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
The following TestFailure was thrown running a test:
Expected: a numeric value within <1e-10> of <19>
  Actual: <0>
   Which:  differs by <19>
When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49  throw_
packages/test_api/src/expect/async_matcher.dart.js 150:22                     fail
packages/test_api/src/expect/async_matcher.dart.js 147:12                     _expect
packages/test_api/src/expect/async_matcher.dart.js 80:12                      expect$
packages/flutter_test/src/matchers.dart.js 5141:12                            expect$
google_maps_controller_test.dart.js 1408:27                                   <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50            <fn>
dart-sdk/lib/async/zone.dart 1406:47                                          _rootRunUnary
dart-sdk/lib/async/zone.dart 1307:19                                          runUnary
dart-sdk/lib/async/future_impl.dart 147:18                                    handleValue
dart-sdk/lib/async/future_impl.dart 767:44                                    handleValueCallback
dart-sdk/lib/async/future_impl.dart 796:13                                    _propagateToListeners
dart-sdk/lib/async/future_impl.dart 567:5                                     [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 640:7                                     <fn>
dart-sdk/lib/async/zone.dart 1398:13                                          _rootRun
dart-sdk/lib/async/zone.dart 1300:19                                          run
dart-sdk/lib/async/zone.dart 1208:7                                           runGuarded
dart-sdk/lib/async/zone.dart 1248:23                                          callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                              _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                               _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15           <fn>
The test description was:
  newLatLngZoom
═════════════════════════════════════════════════════════════════
end of failure 1

@ditman
Copy link
Member

ditman commented Feb 24, 2023

I managed to reproduce this by using the version of chrome that is downloaded by the script (98):

dit@dit:/work/flutter/packages$ CHROME_EXECUTABLE=/tmp/chromium/chrome-linux/chrome ./script/tool_runner.sh drive-examples --web --packages=url_launcher_web

============================================================
|| Running for packages/url_launcher/url_launcher_web [@0:00]
============================================================

Running command: "flutter drive -d web-server --web-port=7357 --browser-name=chrome --chrome-binary=/tmp/chromium/chrome-linux/chrome --driver test_driver/integration_test.dart --target integration_test/link_widget_test.dart" in /work/flutter/packages/packages/url_launcher/url_launcher_web/example
Running "flutter pub get" in example...
Resolving dependencies...
  archive 3.3.2 (3.3.6 available)
  build_daemon 3.1.0 (3.1.1 available)
  build_runner 2.3.3 (2.4.0 available)
  characters 1.2.1 (1.3.0 available)
  collection 1.17.0 (1.17.1 available)
  js 0.6.5 (0.6.7 available)
  matcher 0.12.13 (0.12.14 available)
  meta 1.8.0 (1.9.0 available)
  path 1.8.2 (1.8.3 available)
  test_api 0.4.16 (0.4.18 available)
  vm_service 9.4.0 (11.1.0 available)
  webdriver 3.0.1 (3.0.2 available)
Got dependencies!
Launching integration_test/link_widget_test.dart on Web Server in debug mode...
Waiting for connection from debug service on Web Server...         27.2s
integration_test/link_widget_test.dart is being served at http://localhost:7357
The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome or Edge devices for an improved development workflow.
Failure Details:
Failure in method: uri can be null
══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞══════════════════════
The following assertion was thrown during a scheduler callback:
Assertion failed:
org-dartlang-sdk:///lib/_engine/engine/canvaskit/surface.dart:401:12
!_isDisposed
"Attempting to use the canvas of a disposed surface"

When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49      throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3        assertFailed
lib/_engine/engine/canvaskit/surface.dart 401:13                                  getCanvas
lib/_engine/engine/canvaskit/surface.dart 34:42                                   get skiaCanvas
lib/_engine/engine/canvaskit/embedded_views.dart 418:38                           submitFrame
lib/_engine/engine/canvaskit/rasterizer.dart 36:33                                draw
lib/_engine/engine/canvaskit/renderer.dart 349:16                                 renderScene
lib/_engine/engine/platform_dispatcher.dart 645:14                                render
lib/ui/window.dart 107:50                                                         render
packages/flutter_test/src/window.dart.js 363:21                                   render
packages/flutter/src/rendering/view.dart.js 325:23                                compositeFrame
packages/flutter/src/rendering/view.dart.js 775:25                                drawFrame
packages/flutter/src/widgets/title.dart.js 69849:15                               drawFrame
packages/flutter/src/rendering/view.dart.js 734:12                                [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart.js 866:9                              [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart.js 833:37                             handleDrawFrame
packages/flutter_test/src/test_text_input_key_handler.dart.js 3034:15             handleDrawFrame
packages/flutter/src/scheduler/binding.dart.js 752:12                             [_handleDrawFrame]
dart-sdk/lib/async/zone.dart 1398:13                                              _rootRun
dart-sdk/lib/async/zone.dart 1300:19                                              run
dart-sdk/lib/async/zone.dart 1208:7                                               runGuarded
lib/_engine/engine/platform_dispatcher.dart 1170:9                                invoke
lib/_engine/engine/platform_dispatcher.dart 218:5                                 invokeOnDrawFrame
lib/_engine/engine/initialization.dart 190:45                                     <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 367:37  _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 372:39  dcall
═════════════════════════════════════════════════════════════════

end of failure 1


Failure in method: can be created and disposed
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
The following message was thrown:
Multiple exceptions (21) were detected during the running of the
current test, and at least one was unexpected.
═════════════════════════════════════════════════════════════════

end of failure 2

@ditman
Copy link
Member

ditman commented Feb 24, 2023

This seems to happen when running both "sizes itself correctly" and "uri can be null" tests, and only in headless mode (so I cannot set-up a debugger it seems)

@ditman
Copy link
Member

ditman commented Feb 24, 2023

Adding some pumpAndSettle at the end of the tests seems to heal the issue. This is odd, but it's maybe a race condition where the test runner starts the next test before fully finishing the previous one?

I can't explain why this is not showing up in any other tests, though :/

@ditman
Copy link
Member

ditman commented Feb 24, 2023

Looking at google_maps_flutter_web: example/integration_test/google_maps_controller_test.dart, looks like a Mock is misbehaving?

@ditman
Copy link
Member

ditman commented Feb 24, 2023

The problem with the Maps test seems to be that the map center used to "move" without a map being drawn, but it seems that that is not the case.

Moved the test to the "projection" tests file which mocks less stuff, and instead uses a real map widget rendering on the screen to do computations.

@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 Mar 11, 2023
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 p: url_launcher Plugin to launch external applications P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels. team Infra upgrades, team productivity, code health, technical debt. See also team: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants