KasperskyLab / Kaspresso

Android UI test framework
https://kasperskylab.github.io/Kaspresso/
Apache License 2.0
1.79k stars 150 forks source link

Не получается запустить тесты при запущеном adbserver-desktop.jar #539

Closed m-dorokhin closed 11 months ago

m-dorokhin commented 1 year ago

Здравствуйте!

Не получается запустить тесты при запущеном adbserver-desktop.jar.

Выполняемые действия:

Запускаю adb сервер:

java -jar adbserver-desktop.jar

Затем запускаю тесты:

./gradlew connectedAndroidTest

Тесты падают с ошибкой: com.android.builder.testing.api.DeviceException: No connected devices!

В логах:

04:55:59 D/DeviceMonitor: Opening adb connection
04:55:59 D/DeviceMonitor: Unable to open connection to ADB server: java.io.IOException: Can't find adb server on port 5037, IPv4 attempt: Connection refused: connect, IPv6 attempt: Connection refused: connect
04:56:00 D/DeviceMonitor: Opening adb connection
04:56:00 I/DeviceMonitor: ADB connection re-established after 2 seconds.
04:56:00 E/DeviceMonitor: Adb connection Error:Connection reset
04:56:00 D/DeviceMonitor: Opening adb connection
04:56:00 D/DeviceMonitor: Unable to open connection to ADB server: java.io.IOException: Can't find adb server on port 5037, IPv4 attempt: Connection refused: connect, IPv6 attempt: Connection refused: connect
04:56:00 E/DeviceMonitor: Cannot reach ADB server, attempting to reconnect.
04:56:01 D/DeviceMonitor: Opening adb connection
04:56:01 D/DeviceMonitor: Unable to open connection to ADB server: java.io.IOException: Can't find adb server on port 5037, IPv4 attempt: Connection refused: connect, IPv6 attempt: Connection refused: connect
04:56:02 D/DeviceMonitor: Opening adb connection
04:56:02 D/DeviceMonitor: Unable to open connection to ADB server: java.io.IOException: Can't find adb server on port 5037, IPv4 attempt: Connection refused: connect, IPv6 attempt: Connection refused: connect

Если выключить adbserver-desktop.jar, то тесты запускаются корректно. На другой машине всё работает. Но версия студии, java, Android SDK Platform-Tools на ней те же.

Windows:

$ systeminfo

Host Name:                 LAPTOP-44O275BB
OS Name:                   Майкрософт Windows 10 Домашняя для одного языка
OS Version:                10.0.19045 N/A Build 19045
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          admin
Registered Organization:   N/A
Product ID:                00327-31058-10110-AAOEM
Original Install Date:     25.11.2021, 2:30:59
System Boot Time:          04.07.2023, 18:05:35
System Manufacturer:       Acer
System Model:              Nitro AN517-52
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 165 Stepping 2 GenuineIntel ~2496 Mhz
BIOS Version:              Insyde Corp. V2.03, 24.03.2021
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             ru;Russian
Input Locale:              ru;Russian
Time Zone:                 (UTC+03:00) Moscow, St. Petersburg
Total Physical Memory:     16 215 MB
Available Physical Memory: 8 494 MB
Virtual Memory: Max Size:  26 967 MB
Virtual Memory: Available: 17 360 MB
Virtual Memory: In Use:    9 607 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\LAPTOP-44O275BB
Hotfix(s):                 25 Hotfix(s) Installed.
                           [01]: KB5027122
                           [02]: KB4534170
                           [03]: KB4537759
                           [04]: KB4545706
                           [05]: KB4562830
                           [06]: KB4586864
                           [07]: KB5003791
                           [08]: KB5012170
                           [09]: KB5015684
                           [10]: KB5027215
                           [11]: KB5006753
                           [12]: KB5007273
                           [13]: KB5011352
                           [14]: KB5011651
                           [15]: KB5014032
                           [16]: KB5014035
                           [17]: KB5014671
                           [18]: KB5015895
                           [19]: KB5016705
                           [20]: KB5018506
                           [21]: KB5020372
                           [22]: KB5022924
                           [23]: KB5023794
                           [24]: KB5025315
                           [25]: KB5026879
Network Card(s):           8 NIC(s) Installed.
                           [01]: Intel(R) Wi-Fi 6 AX201 160MHz
                                 Connection Name: Беспроводная сеть
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.88.1
                                 IP address(es)
                                 [01]: 192.168.88.116
                                 [02]: fe80::ff82:4a36:712f:eadb
                           [02]: Killer E2600 Gigabit Ethernet Controller
                                 Connection Name: Ethernet
                                 Status:          Media disconnected
                           [03]: TunnelBear Adapter V9
                                 Connection Name: Ethernet 2
                                 Status:          Media disconnected
                           [04]: TAP-ProtonVPN Windows Adapter V9
                                 Connection Name: Подключение по локальной сети
                                 Status:          Media disconnected
                           [05]: Wintun Userspace Tunnel
                                 Connection Name: ProtonVPN TUN
                                 Status:          Media disconnected
                           [06]: WireGuard Tunnel
                                 Connection Name: wg0
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 10.252.1.113
                           [07]: Kaspersky VPN
                                 Connection Name: Подключение по локальной сети 2
                                 Status:          Media disconnected
                           [08]: Bluetooth Device (Personal Area Network)
                                 Connection Name: Сетевое подключение Bluetooth
                                 Status:          Media disconnected
Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                           Virtualization Enabled In Firmware: Yes
                           Second Level Address Translation: Yes
                           Data Execution Prevention Available: Yes

Android Studio:

Android Studio Flamingo | 2022.2.1 Patch 2
Build #AI-222.4459.24.2221.10121639, built on May 12, 2023
Runtime version: 17.0.6+0-b2043.56-9586694 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 8
Registry:
    external.system.auto.import.disabled=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    gradle.version.catalogs.dynamic.support=true

Non-Bundled Plugins:
    idea.plugin.protoeditor (222.4459.16)

Android SDK 13.0 (Tiramisu) API Level: 33 Revision: 2 Android SDK Platform-Tools: 34.0.3

Java:

$ ./java.exe -version
java version "1.8.0_371"
Java(TM) SE Runtime Environment (build 1.8.0_371-b11)
Java HotSpot(TM) Client VM (build 25.371-b11, mixed mode)

Gradle:

$ ./gradlew --version

------------------------------------------------------------
Gradle 8.0
------------------------------------------------------------

Build time:   2023-02-13 13:15:21 UTC
Revision:     62ab9b7c7f884426cf79fbedcf07658b2dbe9e97

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          17.0.6 (JetBrains s.r.o. 17.0.6+0-b2043.56-9586694)
OS:           Windows 10 10.0 amd64

Версия kaspresso и adbserver-desktop.jar: 1.5.2

Не могу понять почему так происходит. Подскажите хотя бы в какую сторону копать.

AzamatCherchesov commented 1 year ago

@m-dorokhin pls check if any device is connected for running tests

Nikitae57 commented 1 year ago

Hi, @m-dorokhin! The default port for adb server is 5037. Maybe it's already in use. I would suggest passing another port

Nikitae57 commented 11 months ago

Please, re-open if the issue persists