我有一个开源scala项目(https://github.com/lucidsoftware/xtract)。在运行测试时,travis-ci上的构建一直挂起,对于scala 2.11和2.12都是如此。有时它会在编译之后和测试输出之前挂起,有时会在运行测试过程中挂起。我尝试了多次改变travis,包括尝试使用和不使用sudo: false
,sbt的不同版本,以不同的方式分割sbt命令,使用oraclejdk8和openjdk8等。sbt挂在travis-ci上测试期间
我做错了什么或者是这是一个错误?
样品失败:https://travis-ci.org/lucidsoftware/xtract/jobs/280974227
我.travis.yml:
language: scala
scala:
- 2.11.11
- 2.12.3
jdk:
- openjdk8
dist: trusty
sudo: false
cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt/
after_success:
- sbt ++$TRAVIS_SCALA_VERSION package
- |
if [ -n "$TRAVIS_TAG" ] || ([ "$TRAVIS_PULL_REQUEST" == false ] && [ "$TRAVIS_BRANCH" == master ])
then
mkdir ~/.pgp
echo $PGP_PUBLIC | base64 --decode > ~/.pgp/pubring
echo $PGP_SECRET | base64 --decode > ~/.pgp/secring
echo "Publishing snapshot"
sbt ++$TRAVIS_SCALA_VERSION xtract/publishSigned xtractTesting/publishSigned
fi
deploy:
api_key: $GITHUB_AUTH
file:
- xtract-core/target/**/*.jar
- testing/target/**/*.jar
file_glob: true
provider: releases
skip_cleanup: true
on:
tags: true
install: sbt ++$TRAVIS_SCALA_VERSION update
before_cache:
#Avoid unncessary cache updates
- find $HOME/.ivy2 -name "ivydata-*.properties" -print -delete
- find $HOME/.sbt -name "*.lock" -print -delete
编辑
未能与SBT -debug
选项:https://travis-ci.org/lucidsoftware/xtract/jobs/281081862
它做的最后一件事是
[debug] Running TaskDef(com.lucidchart.open.xtract.DefaultXmlReadersSpec, specs2 Specification fingerprint, false, [SuiteSelector])
编辑2
的一些注意事项。该项目有多个子项目。构建在运行测试时暂停,测试在他们自己的项目中进行,因为它们依赖于核心代码以及针对项目特定specs2匹配器的单独子项目。
很多人(包括我)使用Travis一直运行sbt测试没有问题,所以大概这个问题必须涉及到你的项目特定的东西。运行'sbt --debug'而不是普通的'sbt'可能有助于追踪死亡。您可能还会看到特拉维斯是否提供任何方式在作业挂起时获取JVM堆栈跟踪,以帮助排除故障 –
您是否尝试过[forking](http://www.scala-sbt.org/0.12.3/docs/) Detailed-Topics/Forking.html)启用? –
@SzymonBiliński我试过分叉。我遇到了同样的问题。 – Thayne