Aerospike REST Gateway构建失败:Ubuntu 20下gradlew build测试大量不通过
问题
在Ubuntu 20系统上安装Aerospike REST Gateway,执行./gradlew build等待2小时后出现大量测试失败,报错信息如下:
2142 tests completed, 1660 failed > Task :test FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':test'. > There were failing tests. See the report at: file:///home/andalabs/aerospike-rest-gateway/build/reports/tests/test/index.html * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/7.3.1/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 2h 57m 33s 8 actionable tasks: 8 executed
失败测试多来自com.aerospike.restclient包,不清楚遗漏了哪些配置或步骤。
解决思路
- 跳过测试直接构建:若仅需完成安装、无需验证测试,执行
./gradlew build -x test跳过测试阶段,直接生成构建产物,这是最快的临时解决方案。 - 检查本地Aerospike服务:
com.aerospike.restclient的测试依赖本地运行的Aerospike实例,需确认:- 本地已安装并启动Aerospike服务
- 默认端口3000未被占用
- 测试配置中的连接参数与本地实例匹配
- 查看详细测试报告:打开报错中指定的报告文件
/home/andalabs/aerospike-rest-gateway/build/reports/tests/test/index.html,里面会列出每个失败测试的具体原因(如连接超时、数据不存在等),可精准定位问题。 - 清理Gradle缓存后重试:执行
./gradlew clean build清理旧缓存,避免依赖缓存导致的异常。项目自带的./gradlew已适配版本,无需额外安装Gradle。 - 验证Java版本:Aerospike REST Gateway要求Java 8及以上版本,执行
java -version检查本地Java版本是否符合要求。
内容的提问来源于stack exchange,提问作者Lezir Opav
相关产品推荐
相关产品推荐

