Jobs are being killed unexpectedly so remove potential source; Add more timeouts; Extend timeouts

This commit is contained in:
Dan Hawkins 2018-09-18 00:25:06 +01:00
commit bff5c0a833

View file

@ -8,7 +8,7 @@ def doDisplayLeftovers() {
ps aux | grep "eclipse"
ps aux | grep "make"
ps aux | grep "arm-linux"
ps aux | grep "sh"
# ps aux | grep "sh"
"""
}
}
@ -121,8 +121,10 @@ def doBuild(apps, ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sou
// The lock is being used because it was being found that the doKillLeftovers was affecting other builds
lock(resource: "eclipsebuild_${env.NODE_NAME}") {
try {
addToolchainPath(toolchainfolder)
doImportProjects(ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sourcefolder)
timeout(time: 2, unit: 'MINUTES') {
addToolchainPath(toolchainfolder)
doImportProjects(ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sourcefolder)
}
for (appInfo in apps ) {
(build, cleanbuild, project, variants, exportpathlist) = appInfo
if (build) {
@ -134,25 +136,30 @@ def doBuild(apps, ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sou
}
for (build_variant in variants) {
retry(maxprojectbuildretries) { // Eclipse occasionally raises exceptions (rather than the builds failing)
doDisplayLeftovers()
doRegisterToolchain(ds5folder, toolchainfolder)
echo "Build command: ${ds5shellcommand} \'${buildcommand} -no-indexer ${buildtype} \"${project}/${build_variant}\"\'"
if (isUnix()) {
timeout(time: 5, unit: 'MINUTES') {
sh """
echo Start time: `date`
${ds5shellcommand} \'${buildcommand} -no-indexer ${buildtype} \"${project}/${build_variant}\"\'
echo End time: `date`
"""
try {
doDisplayLeftovers()
doRegisterToolchain(ds5folder, toolchainfolder)
echo "Build command: ${ds5shellcommand} \'${buildcommand} -no-indexer ${buildtype} \"${project}/${build_variant}\"\'"
timeout(time: 10, unit: 'MINUTES') {
if (isUnix()) {
sh """
echo Start time: `date`
${ds5shellcommand} \'${buildcommand} -no-indexer ${buildtype} \"${project}/${build_variant}\"\'
echo End time: `date`
"""
}
else {
bat """
"%ds5shellcommand%" "%buildcommand%" -no-indexer ${buildtype} "${project}\\${build_variant}"
"""
}
}
doExport(exportfolder, exportpathlist, "", build_variant)
} catch (Exception e) {
echo "Build failed - Waiting for a while"
sleep(time: 4, unit: 'SECONDS')
error "Build failed..."
}
else {
bat """
"%ds5shellcommand%" "%buildcommand%" -no-indexer ${buildtype} "${project}\\${build_variant}"
"""
}
doExport(exportfolder, exportpathlist, "", build_variant)
}
}
}
@ -164,10 +171,9 @@ def doBuild(apps, ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sou
}
}
} catch (Exception e) {
// doKillLeftovers()
error "Build failed - Killing leftovers"
doKillLeftovers()
}
doKillLeftovers()
}
}