Comments (6)
请问是怎么升级的呢?pom中的releaseMode是什么?后面更改的文件有同步吗?yml文件也请展示下
from sonic-agent.
https://github.com/SonicCloudOrg/sonic-agent/blob/main/src/main/java/org/cloud/sonic/agent/transport/TransportConnectionThread.java 你这个文件是不是自己改动过?可以附上这个文件截图和yml截图,另外请问server是本地部署吗?
from sonic-agent.
文件没有改动,我是这样操作的
- 容器部署最新的 2.3.0 server 端
- pull agent 代码并check 到 tag 2.3.0
- 配置 yml 文件
- 启动agent
然后就一直报上面的连接问题,如果把 agent 代码切换到 2.0.5 则能正常连接,从release 包下载的 2.3.0 agent 也可以
TransportConnectionThread.java
package org.cloud.sonic.agent.transport;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.cloud.sonic.agent.tools.SpringTool;
import java.net.URI;
import java.util.concurrent.TimeUnit;
/**
* @author Eason
* @date 2022/6/12 02:45
*/
@Slf4j
public class TransportConnectionThread implements Runnable {
/**
* second
*/
public static final long DELAY = 10;
public static final String THREAD_NAME = "transport-connection-thread";
public static final TimeUnit TIME_UNIT = TimeUnit.SECONDS;
String serverHost = String.valueOf(SpringTool.getPropertiesValue("sonic.server.host"));
Integer serverPort = Integer.valueOf(SpringTool.getPropertiesValue("sonic.server.port"));
String key = String.valueOf(SpringTool.getPropertiesValue("sonic.agent.key"));
boolean isRelease = Boolean.valueOf(SpringTool.getPropertiesValue("sonic.release-mode"));
@Override
public void run() {
Thread.currentThread().setName(THREAD_NAME);
if (TransportWorker.client == null) {
if (!TransportWorker.isKeyAuth) {
return;
}
String url = String.format("ws://%s:%d%s/websockets/agent/%s",
serverHost, serverPort, isRelease ? "/server" : "", key).replace(":80/", "/");
URI uri = URI.create(url);
TransportClient transportClient = new TransportClient(uri);
transportClient.connect();
} else {
JSONObject ping = new JSONObject();
ping.put("msg", "ping");
TransportWorker.send(ping);
}
}
}
application-sonic-agent.yml
sonic:
agent:
# Replace with ipv4 of the agent machine | 替换为部署Agent机器的ipv4
host: 10.91.xx.xx
# Replace with the port of the agent service, which can be changed by yourself | 替换为Agent服务的端口,可以自行更改
port: 7777
# Replace with the key of agent generated by the new front-end | 替换为前端新增Agent生成的key
key: 02aa2ca9-xxxx-abc808f178b5
server:
# Change to SONIC_SERVER_HOST of server | 改成server的SONIC_SERVER_HOST
host: 9.134.xx.xx
# Change to SONIC_SERVER_PORT of server | 改成server的SONIC_SERVER_PORT
port: 3000
modules:
android:
# Whether to enable Android module | 是否开启安卓模块
enable: true
# Whether to enable sonic-android-supply module | 是否开启sonic-android-supply功能
use-sas: true
ios:
# Whether to turn on the iOS module. Please ensure that iTunes is installed on this computer for Windows users | 是否开启iOS模块。开启的windows用户请确保本机已安装iTunes
enable: true
# Replace with the bundleId of wda. If there is no. xcrunner suffix, it will be automatically completed. | 替换为wda的bundleId,如果没有.xctrunner后缀会自动补全
wda-bundle-id: com.sonic.WebDriverAgentRunner
sgm:
# Whether to enable the sonic-go-mitmproxy module | 是否开启sonic-go-mitmproxy功能
enable: true
from sonic-agent.
找到问题的解决方法了,pom.xml 文件中修改releaseMode 为 true, 虽然不是很明白,但解决了 @ZhouYixun
<properties>
<platform>macosx-x86_64</platform>
<releaseMode>false</releaseMode>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
</properties>
releaseMode 改为 true
<properties>
<platform>macosx-x86_64</platform>
<releaseMode>true</releaseMode>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
</properties>
from sonic-agent.
from sonic-agent.
并不是问题,如果你开发环境的Agent连接开发环境的server是不会有问题的,但是如果你开发环境的Agent连生产环境的server,需要pom.xml 文件中修改releaseMode 为 true
而官方部署文档,是生产环境的Agent连生产环境的Server,所以没问题
不过恭喜你解决问题,我这边先关闭issue,祝您使用愉快
from sonic-agent.
Related Issues (20)
- [Bug] 小米13pro touch事件触发后投屏没反应 HOT 5
- 【issue】iOS自动化 PBItemCollectionServicer connection disconnected."错误 ,导致页面短暂卡死 HOT 2
- [Invalid] 这个帖子链接打不开了 Q2: 使用后没有出现画面,但是按键操作正常。 A1: 解决方案可参考 这个帖子。 HOT 1
- [QUESTION] 自定义脚本-如何调用Mac电脑(作为Agent)的python HOT 4
- [Invalid] Python-调用mongodb功能无法使用 HOT 2
- [Bug] 手机状态有时候没有占用提示占用着
- [Feature] 测试中不能查看远程真机画面,无法查看自动化的情况 HOT 1
- [Bug] 批量执行自动化时运行状态有时候不会结束,用例都提示失败了还没结束,手机也没释放提示在测试中
- [Invalid] 应用安装没有进度,有时候会安装失败 HOT 2
- Android6设备使用minicap黑屏,scrcpy正常 HOT 1
- [Bug] 自定义脚本,全局参数赋值之后,值没有变化。 HOT 2
- [Bug] iOS17挂载问题,目前sonic不支持,但是现在大批量设备都已经升级了17系统,WebDriverAgent server start failed: receive packet: InvalidService
- [help] IOS手机隔一段时间就会断开连接要怎么办? HOT 2
- [Help] agent启动后显示hub is not ready. ignore HOT 2
- [Bug] 安卓「华为、OPPO」获取控件元素报错,小米手机是OK的
- [Bug] 是否有计划针对 iOS17 设备修改 wda 的启动和调用逻辑? HOT 5
- 【错误或体验】网络抓包时,Google Play无法联网;网络抓包没有停止功能。
- [Help] 安卓APP 使用“控件元素”只能获取到 原生控件,获取不到内嵌的H5控件,请大佬帮忙看看怎么解决,谢谢 HOT 2
- [help] 我们sonic现在不定时弹窗有处理吗,这个方案能集成进去吗https://testerhome.com/topics/12938
- 使用无线调试的时候,uia返回超时,使用postman请求,一个请求要两百多秒才返回。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonic-agent.