Commit 1f8d543b authored by Tristan Cavelier's avatar Tristan Cavelier

JIO job management does not recover waiting jobs -> fixed

parent 6d56aa38
......@@ -46,7 +46,8 @@ function enableJobRecovery(jio, shared, options) {
for (i = 0; i < job_array.length; i += 1) {
if (job_array[i].state === 'ready' ||
job_array[i].state === 'running') {
job_array[i].state === 'running' ||
job_array[i].state === 'waiting') {
delay = numberOrDefault(job_array[i].timeout + recovery_delay,
recovery_delay);
deadline = new Date(job_array[i].modified).getTime() + delay;
......
......@@ -70,7 +70,7 @@ function enableJobRetry(jio, shared, options) {
param.max_retry > param.tried) {
param.state = 'waiting';
param.modified = new Date();
shared.emit('jobStateChange', param);
shared.emit('jobStop', param);
setTimeout(function () {
param.state = 'ready';
param.modified = new Date();
......
......@@ -843,21 +843,21 @@
"workspace": workspace
});
clock.tick(17998); // now: 19999 ms
clock.tick(17999); // now: 20000 ms
if (fakestorage['Job Recove/post']) {
ok(false, "Command called, job recovered to earlier");
}
clock.tick(1); // now: 20000 ms
clock.tick(1); // now: 20001 ms
if (!fakestorage['Job Recove/post']) {
ok(false, "Command not called, job recovery failed");
} else {
ok(true, "Command called, job recovery ok");
}
fakestorage['Job Recove/post'].success({"id": "a"});
clock.tick(1); // now: 20001 ms
clock.tick(1); // now: 20002 ms
deepEqual(workspace, {}, 'No more job in the queue');
clock.tick(79999); // now: 100000 ms
clock.tick(79998); // now: 100000 ms
//////////////////////////////
// XXX Waiting for jobs job recovery
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment