(进阶)Jenkins 提示“testng-results.xml was last modified before this build started”

0. 错误Log

13:40:25 TestNG Reports Processing: START
13:40:25 Looking for TestNG results report in workspace using pattern: test-output/testng-results.xml
13:40:25 testng-results.xml was last modified before this build started. Ignoring it.
13:40:25 Saving reports...
13:40:25 Found matching files but did not find any TestNG results.

Jenkins TestNG 在解析report 时候出现上述错误, 导致job 无论成功与否都是返回SUCCESS

1. Root Cause :

Jenkins slave 和 master 时间不同步


image.png

2. 解决方法(CentOS 7)

  • 安装NTP 服务
# install ntp service
yum install ntp -y
sed -i 's/^server/#server/g' /etc/ntp.conf

cat <> /etc/ntp.conf
#Conifgure ntp servers same as jenkins-master
server 1.ntp.xxx.xxx.com iburst
server 2.ntp.xxx.xxx.com iburst
server ntp1.xxx.xxx.xxx.com iburst
server ntp2.xxx.xxx.xxx.com iburst
EOF

service ntpd start
  • 确保slave 和master 处于In sync状态
    image.png

你可能感兴趣的:((进阶)Jenkins 提示“testng-results.xml was last modified before this build started”)