Closed GuillaumeMorinQc closed 1 year ago
First of all, thanks for the great work in making flutter work on embedded!
I have a similar issue as above when running integration tests on target device. The tests timeouts after 12 minutes.
I am following the flutter integration test example for testing out integration testing using flutter-elinux
on a target device.
flutter-elinux test integration_test/counter_test.dart -vv -d imx8mm
flutter-elinux doctor -v
flutter-elinux test integration_test -v
runs succesfullyI built the application using your guide for cross-building with Yocto SDK. Running the application gives the following output:
flutter-elinux run -d imx8mm
Launching lib/main.dart on eLinux in debug mode...
Uninstall sample from imx8mm.
Uninstallation Success
Install sample (build/elinux/arm64/debug/bundle) to imx8mm
Installation Success
Launch sample.name on imx8mm
Syncing files to device eLinux... 176ms
Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
💪 Running with sound null safety 💪
An Observatory debugger and profiler on eLinux is available at: http://127.0.0.1:39813/Av7QB2pe2qg=/
The Flutter DevTools debugger and profiler on eLinux is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:39813/Av7QB2pe2qg=/
My ~/.dlutter_custom_devices.json
looks like:
{
"custom-devices": [
{
"id": "imx8mm",
"label": "Instrument 0",
"sdkNameAndVersion": "Instrument 0",
"enabled": true,
"platform": "arm64",
"backend": "wayland",
"ping": [
"ping", "-w", "500", "-c", "1", "192.168.12.154"
],
"pingSuccessRegex": "ttl=",
"install": [
"scp", "-r", "${localPath}", "root@192.168.12.154:/tmp/${appName}"
],
"uninstall": [
"ssh", "root@192.168.12.154", "rm -rf \"/tmp/${appName}\""
],
"runDebug": [
"ssh", "root@192.168.12.154", "export XDG_RUNTIME_DIR=/run/user/0; export WAYLAND_DISPLAY=wayland-0;/tmp/${appName}/${appName}"
],
"forwardPort": [
"ssh", "-o", "ExitOnForwardFailure=yes",
"-L", "127.0.0.1:${hostPort}:127.0.0.1:${devicePort}", "root@192.168.12.154"
],
"forwardPortSuccessRegex": ""
}
]
}
Sorry for no updates for a long time.
I was able to run integration test (flutter integration test example) on Raspberry Pi4 (Raspberry Pi OS). Can you please try the following steps? You need to run flutter-elinux test
command first. Sorry for the inconvenient way.
Build:
$ flutter-elinux test integration_test
$ mv build/elinux/<arch>/debug/bundle/data ./integration_test_bundle_data
$ flutter-elinux build elinux --debug # <= need cross-building if needed
$ rm -rf build/elinux/<arch>/debug/bundle/data
$ cp -rf integration_test_bundle_data build/elinux/<arch>/debug/bundle/data
Run integration test:
$ flutter-elinux test integration_test -d raspberry-pi4 --verbose
[ +20 ms] executing: [/home/hidenori/work/flutter/flutter-elinux/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +12 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] f468f3366c26a5092eb964a230ce7892fda8f2f8
[ ] executing: [/home/hidenori/work/flutter/flutter-elinux/flutter/] git tag --points-at f468f3366c26a5092eb964a230ce7892fda8f2f8
[ +18 ms] Exit code 0 from: git tag --points-at f468f3366c26a5092eb964a230ce7892fda8f2f8
[ ] 3.10.6
[ +2 ms] executing: [/home/hidenori/work/flutter/flutter-elinux/flutter/] git rev-parse --abbrev-ref HEAD
[ +3 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] HEAD
[ ] executing: [/home/hidenori/work/flutter/flutter-elinux/flutter/] git rev-parse --abbrev-ref --symbolic @{upstream}
[ +2 ms] Exit code 128 from: git rev-parse --abbrev-ref --symbolic @{upstream}
[ ] fatal: HEAD does not point to a branch
[ +12 ms] Unable to locate an Android SDK.
[ +5 ms] executing: uname -m
[ +1 ms] Exit code 0 from: uname -m
[ ] aarch64
[ +69 ms] Found plugin integration_test at /home/hidenori/work/flutter/flutter-elinux/flutter/packages/integration_test/
[ +15 ms] Found plugin integration_test at /home/hidenori/work/flutter/flutter-elinux/flutter/packages/integration_test/
[ +8 ms] Found plugin integration_test at /home/hidenori/work/flutter/flutter-elinux/flutter/packages/integration_test/
[ +15 ms] Found plugin integration_test at /home/hidenori/work/flutter/flutter-elinux/flutter/packages/integration_test/
[ +2 ms] Found 1 files which will be executed as Integration Tests.
[ +1 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +4 ms] Artifact Instance of 'ELinuxEngineArtifacts' is not required, skipping update.
[ +5 ms] executing: ping -w 500 -c 1 192.168.10.22
[ +107 ms] PING 192.168.10.22 (192.168.10.22) 56(84) bytes of data.
64 bytes from 192.168.10.22: icmp_seq=1 ttl=128 time=96.2 ms
--- 192.168.10.22 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 96.241/96.241/96.241/0.000 ms
[ +3 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +5 ms] Artifact Instance of 'ELinuxEngineArtifacts' is not required, skipping update.
[ +5 ms] Skipping pub get: version match.
[ +9 ms] Found plugin integration_test at /home/hidenori/work/flutter/flutter-elinux/flutter/packages/integration_test/
[ +15 ms] Found plugin integration_test at /home/hidenori/work/flutter/flutter-elinux/flutter/packages/integration_test/
[ +5 ms] Found plugin integration_test at /home/hidenori/work/flutter/flutter-elinux/flutter/packages/integration_test/
[ +23 ms] Generating /home/hidenori/work/flutter/sample/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +58 ms] running test package with arguments: [--concurrency=1, --chain-stack-traces, --,
file:///home/hidenori/work/flutter/sample/integration_test/app_test.dart]
00:00 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart [ +71 ms] test 0: starting test /home/hidenori/work/flutter/sample/integration_test/app_test.dart
[ +2 ms] Stopping scan for flutter_test_config.dart; found project root at /home/hidenori/work/flutter/sample
[ ] test 0: starting test device
[ +1 ms] test 0: awaiting connection to test device
[ +5 ms] Uninstall sample from raspberry-pi4.
[ ] executing: ssh hidenori@192.168.10.22 rm -rf "/tmp/sample"
00:10 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart
00:12 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart
[+12848 ms] Permission denied, please try again.
[ +1 ms] Uninstallation Success
[ +1 ms] Install sample (build/elinux/arm64/debug/bundle) to raspberry-pi4
[ ] executing: scp -r build/elinux/arm64/debug/bundle hidenori@192.168.10.22:/tmp/sample
00:20 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart
00:22 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart
00:25 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart
00:38 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart
00:51 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart
01:18 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart [+65533 ms] Permission denied, please try again.
[ ] Installation Success
[ ] Launch sample.name on raspberry-pi4
01:21 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart
01:23 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart
01:24 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart [+6296 ms] VM Service URL on device: http://127.0.0.1:43155/fOz1HKJpCJk=/
[ +1 ms] executing: ssh -o ExitOnForwardFailure=yes -L 127.0.0.1:43155:127.0.0.1:43155 hidenori@192.168.10.22
02:07 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart
02:11 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart
02:12 +0: loading /home/hidenori/work/flutter/sample/integration_test/app_test.dart [+47369 ms] Forwarded host port 43155 to device port 43155 for VM Service
[ +1 ms] test 0: Connecting to vm service
[ +6 ms] test 0: VM Service uri is available at http://127.0.0.1:43155/fOz1HKJpCJk=/
[ +387 ms] test 0: Finding the correct isolate with the integration test service extension
[ +87 ms] test 0: connected to test device, now awaiting test result
[ ] test 0: Waiting for test harness or tests to finish
02:16 +1: (tearDownAll) [+4371 ms] test 0: Test harness is no longer needed by test process
[ ] test 0: finished
[ ] test 0: cleaning up...
[ ] test 0: ensuring test device is terminated.
[ ] test 0: Test process is no longer needed by test harness
[ ] Uninstall sample from raspberry-pi4.
[ ] executing: ssh hidenori@192.168.10.22 rm -rf "/tmp/sample"
02:46 +1: (tearDownAll)
02:49 +1: (tearDownAll)
[+32736 ms] Permission denied, please try again.
[ ] Uninstallation Success
[ ] test 0: deleting temporary directory
[ ] test 0: finished
02:49 +1: All tests passed!
[ +4 ms] test package returned with exit code 0
[ +4 ms] "flutter test" took 170,067ms.
[ +24 ms] ensureAnalyticsSent: 0ms
[ ] Running 1 shutdown hook
[ ] Shutdown hooks complete
[ ] exiting with code 0
Added Integration test on target device to Wiki. Closing. Thank you.
I'm trying to use flutter integration tests on a remote arm64 device. When I launched the following command the application is deployed and launched, but when it time to run tests nothing happens for 12 minutes. The application is the default app with counter and button to increment it.
There is the result of my flutter-arm doctor :