task.py run_vidjil check for failure before reschedule

The if statements that checks whether the pre_process is not COMPLETED
of DONE doesn't account for when the pre_process has FAILED, so checking
whether the pre_process has failed before rescheduling a new process,
prevents an infinite loop of queued processes.

See #3606
3 jobs for feature-s/3606-fix-pre-process-failure-loop in 1 minute and 7 seconds
latest
Status Job ID Name Coverage
  Test Tools
passed #194244
test_tools

00:00:06

 
  Test Unit
passed #194245
web
test_server_unit

00:00:23

 
  Test Functional
failed #194246
docker x86_64
test_server_functional

00:00:37

 
Name Stage Failure
failed
test_server_functional Test Functional
2018-11-02 16:38:25 (5.51 MB/s) - '/usr/local/bin/gosu.asc' saved [543/543]

+ mktemp -d
+ export GNUPGHOME=/tmp/tmp.KqHNsqKLFY
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
gpg: keybox '/tmp/tmp.KqHNsqKLFY/pubring.kbx' created
gpg: keyserver receive failed: Cannot assign requested address
The command '/bin/sh -c set -x && apt-get update && apt-get install -y --no-install-recommends ca-certificates wget cron unzip make python ipython python-enum34 python-requests git python-ijson libyajl2 python-cffi gnupg2 && rm -rf /var/lib/apt/lists/* && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" && export GNUPGHOME="$(mktemp -d)" && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc && chmod +x /usr/local/bin/gosu' returned a non-zero code: 2
ERROR: Job failed: exit status 1