diff options
-rw-r--r-- | ci/_test-git-branch.sh | 4 | ||||
-rwxr-xr-x | ci/get-test-job.sh | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/ci/_test-git-branch.sh b/ci/_test-git-branch.sh index 3924d23..2f5803f 100644 --- a/ci/_test-git-branch.sh +++ b/ci/_test-git-branch.sh @@ -22,7 +22,7 @@ sync_git_repos() local repo for repo in ${JOBSERVER_GIT_REPOS[@]}; do - (cd ~/$repo; git_fetch $repo || true; git checkout -f FETCH_HEAD) > /dev/null + (cd ~/$repo; git_fetch $repo && git checkout -f FETCH_HEAD) || true > /dev/null done } @@ -51,7 +51,7 @@ if [[ -z $TEST_PATH ]]; then exit 1 fi -echo "Running test $TEST_PATH for branch $BRANCH and commit $COMMIT" +echo "Running test $TEST_NAME for branch $BRANCH and commit $COMMIT" sync_git_repos git_fetch linux $COMMIT diff --git a/ci/get-test-job.sh b/ci/get-test-job.sh index bffba78..8b0e2a9 100755 --- a/ci/get-test-job.sh +++ b/ci/get-test-job.sh @@ -3,8 +3,17 @@ [[ -f ~/.ktestrc ]] && . ~/.ktestrc # Clean stale test jobs: + cd $JOBSERVER_OUTPUT_DIR -find -size 0 -cmin +180 |xargs rm -f > /dev/null + +if [[ ! -f stale-job-cleanup ]]; then + touch stale-job-cleanup +fi + +if [[ $(find stale-job-cleanup -mmin +5) ]]; then + find -size 0 -cmin +180 |xargs rm -f > /dev/null + touch stale-job-cleanup +fi cd $JOBSERVER_HOME/linux flock --nonblock .git_fetch.lock git fetch --all > /dev/null |